I created a very simple C# application to retrieve a single record from our JIRA server via REST. It wasn't working to I used the example provided by JIRA and it looks like this:
Jira jiraConn = Jira.CreateRestClient("<omitted>", "<omitted>", "<omitted>");
var issues = from i in jiraConn.Issues.Queryable
where i.Project == "<omitted>"
orderby i.Created
select i;
foreach (var issue in issues)
{
if (issue != null)
{
Debug.WriteLine(issue.Project);
Debug.WriteLine(issue.Key);
Debug.WriteLine(issue.JiraIdentifier);
Debug.WriteLine(issue.Assignee);
}
}
It only retrieves 15 records and then it throws an error in the "foreach" statement
Exception thrown: 'System.NullReferenceException' in Newtonsoft.Json.dll
Object reference not set to an instance of an object.
I have also tried just a single query and it works on some issues such as the ones which were successfully returned but not on others. We make extensive use of custom fields in our JIRA issues and I have version 12.1.1 of the Atlassian SDK and version 4.7.1 of System.Text.Json
Thanks
Jerry
Hi @Jerome R. Anderson -- Welcome to the Atlassian community!
Of the fields you are trying to write, Assignee could be null, right? Consider running your filter by hand in JIRA to confirm by your record count where the problem occurs in the result set. If Assignee is the issue, add null handling for it and any relevant fields.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.