Giter Site home page Giter Site logo

jira.sdk's People

Contributors

alexeyzimarev avatar aripatrick avatar docbender avatar jeroenverh avatar jonas0007 avatar raayu83 avatar user20369502 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jira.sdk's Issues

GetWorklogs does not give all worklogs

Hi,

Here is the code I use to get all worklogs for an issue.

Issue issue = this.JiraClient.GetIssue(issueKey);
IEnumerable<Worklog> worklogs = issue.GetWorklogs();

When I run this I am not getting all worklogs instead I am only getting 20 worklogs. I have 30 worklogs in the issue.

Regards,
Viraj

.Net Core support

Currently this library requires the full .net framework. Since there is no real need for the full framework I would like to suggest to have this library working with .net core.

Support async apis

I need to do some JIRA integration and was looking at this project. I notice that none of the methods return Tasks. Would it not be a lot better to use async/await rather than block the thread indefinitely?

SprintID always -1

I always get -1 on every issue's SprintID.
The reason seems to be that customfield_10354 is empty (at least in debugging view).
The strange thing is that the API actually returns data for customfield_10354.
It looks like this:

"customfield_10354":["com.atlassian.greenhopper.service.sprint.Sprint@3fd7dd59[rapidViewId=58,state=CLOSED,name=2016 KW07-08,startDate=2016-02-09T14:24:02.654Z,endDate=2016-02-23T14:24:00.000Z,completeDate=2016-02-23T14:01:12.378Z,sequence=48,id=48]","com.atlassian.greenhopper.service.sprint.Sprint@75051ecd[rapidViewId=58,state=CLOSED,name=2016 KW09-10,startDate=2016-02-23T14:02:04.657Z,endDate=2016-03-08T14:02:00.000Z,completeDate=2016-03-08T13:16:42.469Z,sequence=49,id=49]","com.atlassian.greenhopper.service.sprint.Sprint@718eef48[rapidViewId=58,state=ACTIVE,name=2016 KW11-12,startDate=2016-03-08T13:17:36.689Z,endDate=2016-03-22T13:17:00.000Z,completeDate=<null>,sequence=50,id=50]"]

Do you habe any idea why this custom field isn't visible inside the Jira.SDK library?

Issue AddIssue(IssueFields issueFields) method fails

Issue AddIssue(IssueFields issueFields) method fails when issueFields.CustomFields = null when no custom fields are specified.

You should add null check to foreach (KeyValuePair<String, CustomField> customfield in issueFields.CustomFields)
or
add CustomFields = new Dictionary<string, CustomField>() to IssueFields class instantiation.

Is this project being currently worked on?

Support for Affects Version/s field

Hi,

I'm trying to implement support for the affect version/s field, but I'm hitting a wall.
I tried to do it the same way that fix versions is implementend, in Issue.cs:
`
public List AffectsVersions { get; set; }

        AffectsVersions = new List<ProjectVersion>();
        if (fields.ContainsKey("versions") && fields["versions"] != null)
        {
            JArray versionArray = (JArray)fields["versions"];
            if (versionArray.Count > 0)
            {
                AffectsVersions = ((JObject)fields["versions"]).ToObject<List<ProjectVersion>>();
            }
        }

`

But I get an error when I run this version.
I don't know much about this library or the JSON format used for the versions field, so I'm pretty much stuck here.
Would be grateful for any ideas on how to do it.

Search Issue call is failing from today

Hi,

I have been using the version of nuget package Jira.SDK 1.2.25 and is working fine for us, all we are doing is passing a jql and getting the issues list. but not sure what happened, am started to get the following error when SearchIssue method is called

"Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
Source=Newtonsoft.Json
from stack trace it is coming from
at Newtonsoft.Json.JsonTextReader.ParseValue()

at Newtonsoft.Json.JsonTextReader.Read()

at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)

at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)

at Jira.SDK.JiraClient.DeserializeIssues(String json)

at Jira.SDK.JiraClient.GetIssues(String url, Dictionary2 parameters, Dictionary2 keys)

at Jira.SDK.JiraClient.SearchIssues(String jql, Int32 maxResults)

NullReferenceException when calling Issue.GetCustomFieldValue(string)

When using the Issue.GetCustomFieldValue(string) method I receive an NullReferenceException. I use it as following:

JiraClient client = new JiraClient("aUserName, "aPassword", "aUrl");
List<Issue> issues = client.SearchIssues("aFilter");

foreach(Issue iss in issues)
{
     string remotelink = iss.GetCustomFieldValue("remotelink");
}

I get some issue back, but when I call the GetCustomFieldValue on the remotelink field I get the exception. I would assume getting an argument exception if the field does not exist. Is there a way to get a result for remotelink at all?

Support source stepping using GitLink

Today I was having a few issues with the library (when actually integrating this into GitTools.Core, which is used by GitLink). However, the library is a black box so it's hard to understand where it's going wrong. Would be great if the source would be "steppable".

For more information, see https://github.com/GitTools/GitLink

Due Date

I don't see support for the Due date in the Issue. Is there any workaround for that?

Thanks in advance

Worklog Id

Hi Jonas, can you please add the Property ID to the Worklog class?

How to do pagination

How to do pagination when extracting Issues. I found that we can set the maxLimit using the below statement but JIRA will return only 1000 issues per request.

Connection.SearchIssues(JQL,1000)

What if JQL result has more that 1000?

InvalidCastException within RestSharp

Great project, , it was so encouraging at first.

I am calling Sprint.GetIssues and the IRestReponse object indicates an exception is occuring:
{"Unable to cast object of type 'System.String' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]'."}.

I can see the raw response and it contains a ton of data. Where can I even begin debugging this?

CustomFields

I'm trying to read custom fields of an issue, but they seem to be null.
What am I doing wrong?

I'm accessing them using this style:
issue.CustomFields["10362"]

Create Issue returns null reference

Trying to add a basic issue to a project, I get a Null Reference. I have tried it with copying the issue fields from an existing issue, and same problem.

This is the code, and the login works and the project is fetched:

var project = jira.GetProject("CONNECT2");
            var issueType = new Jira.SDK.Domain.IssueType(10100, "Feedback");
            var issueFields = new Jira.SDK.Domain.IssueFields
            {
                Summary = "Site Feedback",
                Description = model.FeedbackText,
                IssueType = issueType
            };
            
            project.CreateIssue(issueFields);

The field 'FixVersions' is empty in an issue

I fixed a bug in the code, Issue.cs line 575-582 where the FixVersion property is set on an issue.

The problem is the use of a capital bij Jira and not by the code :)
After fixing that, the use of JObject is wrong, it should be JArray.

I created a branch with the fix, but somehow I cannot push it to origin (permission denied).

New code:
FixVersions = new List();
if (fields.ContainsKey("fixVersions") && fields["fixVersions"] != null)
{
JArray versionArray = (JArray)fields["fixVersions"];
if (versionArray.Count > 0)
{
FixVersions = ((JArray)fields["fixVersions"]).ToObject<List>();
}
}

CustomFields with slash in name not working

Hi,

I'm trying to retrieve a CustomField using GetCustomFieldValue, but it doesn't work because there is a slash in the CustomField Name.
Is there any way to work around this?
I already tried encoding the slash as %2F, but it didn't work.

Best regards
Klaus

Get All Issues not working

GetIssues method is not bringing more than 100 issues, even passing the max parameter with 500 or more.

Can you help me?

Update Issues

This SDK is so cool! Finally a kit that can handle custom fields properly via the rest client. However, I have not figured out how to update a Jira issue using the kit. Any advice on that?
Karl

Connecting to Jira - Invalid JSON string

Hello, we have an error since few days:

Calling: "Public Sub Connect(url As String, username As String, password As String)"

Then exception occurs:

Message: "Invalid JSON string"
Source: "Jira.SDK"
Trace:

   en Jira.SDK.JiraClient.Execute[T](JiraObjectEnum objectType, Dictionary`2 parameters, Dictionary`2 keys)
   en Jira.SDK.JiraClient.GetFields()
   en Jira.SDK.Jira.Connect(String url, String username, String password)
   en JiraToTfs.JiraController.LoadJiraIssues(Dictionary`2 kv, Dictionary`2 kvg, Dictionary`2 kvqa, Dictionary`2 kvdev) en...

We use last version Jira.SDK 1.2.24

Ty

Access to the repository

Give me access to the repository, I made some improvements for the library (project->Components)

how do I create a worklog item?

As per subject, is there anything in the SDK to support adding work logs?
I can see there's code to download workflogs but not to add any.

All issue interactions cause NullRef

I can fetch all project details, but any issue calls cause a NullRef in Newtonsoft.JSON.

Simple Example:
jiraConn.SearchIssues("project = CM AND fixVersion = 5.2 and issuetype = Release");

Stacktrace:

   at Newtonsoft.Json.Linq.JToken.EnsureValue(JToken value)
   at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value)
   at Jira.SDK.Domain.IssueSearchResult..ctor(JObject searchResult)
   at Jira.SDK.JiraClient.DeserializeIssues(String json)
   at Jira.SDK.Jira.SearchIssues(String jql)
   at DevWallboard.ViewModels.ReleasesViewModel.<>c__DisplayClass10_0.<GetFromJira>b__1() in 

https://{ourURL}/rest/api/2/search?jql=

returns lots of stuff.

SearchIssues method crashes with "Value cannot be null" exception

Problem:
I pass a large set of issue numbers to SearchIssues method, some of them are outdated and don't exist anymore. By default, if JQL query contains expression with missing issue number (issue=PROJ-1234), jira server returns Bad request with error
An issue with key 'PROJ-1234' does not exist for field 'issue'.
Jira.SDK doesn't handle this error, tries to parse error response json as a list of issues and crashes with very unclear exception message "value cannot be null".

I see two problems here:

  • Jira SDK doesn't allow to pass custom query parameters in general and validateQuery parameter in particular. If validateQuery=false, Jira just ignores missing issues, but it's not possible to pass this parameter to the Rest client.
  • Jira SDK checks ResponseStatus to make sure request was succeeded, but in case I'm talking about ResponseStatus is ResponseStatus.Completed and it is needed to check StatusCode instead.

Trouble creating new Issue

Hello,

I'm having trouble creating a simple issue through the API.

The serialization (after calling JiraClient.AddIssue()) is throwing errors for every empty property in the issue. I'm trying something like:

       JiraClient jc = new JiraClient(JIRA_BASE_URL, JIRA_LOGIN,JIRA_PASSWORD);

        Issue newIssue = new Issue();
        newIssue.Fields = new IssueFields();
        newIssue.Subtasks = new List<Issue>();
        newIssue._comments = new List<Comment>();
        newIssue.Fields.TimeTracking = new TimeTracking();
        newIssue.Description = "asdf";
        newIssue.Summary = "asdf";
        newIssue.Fields.Project = targetProject;  // Project instance.

        jc.AddIssue(newIssue);  // Still a lot of Fields to initialize 

Still a lot of fields to populate by the looks of it.... Is there a better way? What would be the minimum ammount of fields we have to populate for AddIssue ()'s serialization to work.?

Issue Epic causes NullReferenceException

For some reason it seams that accessing the Epic can cause a null reference exception.
E.g. the following code causes it:
issueEdited.Epic = issue.Epic == null ? "" : "";

Could this be a problem with issues without Epics?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.