jonas0007 / jira.sdk Goto Github PK
View Code? Open in Web Editor NEWSDK for Jira integration in .net
License: Apache License 2.0
SDK for Jira integration in .net
License: Apache License 2.0
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
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.
Is there support for using Proxys?
I need to do some JIRA integration and was looking at this project. I notice that none of the methods return Task
s. Would it not be a lot better to use async
/await
rather than block the thread indefinitely?
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 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?
To speed up search queries I'd like the ability to filter only the fields I need.
jiraClient.SearchIssues(jql, 100, "summary,description");
See Request QUERY PARAMETERS at https://docs.atlassian.com/jira/REST/server/#api/2/search-search
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.
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, Dictionary
2 keys)
at Jira.SDK.JiraClient.SearchIssues(String jql, Int32 maxResults)
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?
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
maxResults is currently hardcoded to 700
I don't see support for the Due date in the Issue. Is there any workaround for that?
Thanks in advance
Hi Jonas, can you please add the Property ID to the Worklog class?
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?
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?
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"]
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);
Is there a way to access an issues Component?
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>();
}
}
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
GetIssues method is not bringing more than 100 issues, even passing the max parameter with 500 or more.
Can you help me?
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
I can't find attachments fields in issue object. Can you help me?
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
Give me access to the repository, I made some improvements for the library (project->Components)
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.
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.
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:
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.?
I think that it's not possible to check out public JIRA instances. For example, I use this:
jira.Connect("someurl", null, null);
Even in that case, you create the auth values:
https://github.com/jonas0007/Jira.SDK/blob/master/Jira.SDK/JiraClient.cs#L74
I think the auth values should only be created when both username / password are provided.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.