Hi ,
I am fetching (story or sub-task) data from JIRA SDK with following nuget package
<package id="Atlassian.SDK" version="12.1.0" targetFramework="net46" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
<package id="RestSharp" version="106.10.1" targetFramework="net46" />
I used below function to fetch the result
IPagedQueryResult<Issue> result = await jira.Issues.GetIssuesFromJqlAsync("project = 'CREDRE' AND issuetype='Story' and updatedDate>= -4d ORDER BY id DESC", int.MaxValue);
but some some story or task it return an error giving a null reference exception.
Please see attached screens of exact issue while fetching (story or sub-task) from JIRA API.
Stack Trace error :
at Atlassian.Jira.Remote.MultiObjectCustomFieldValueSerializer.<FromJson>b__2_0(JToken j)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Atlassian.Jira.Remote.MultiObjectCustomFieldValueSerializer.FromJson(JToken json)
at Atlassian.Jira.Remote.RemoteIssueJsonConverter.<GetCustomFieldValuesFromObject>b__9_1(JProperty field)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Atlassian.Jira.Remote.RemoteIssueJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Atlassian.Jira.Remote.IssueService.<>c_DisplayClass20_0.<GetIssuesFromJqlAsync>b_2(JObject issueJson)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.SystemCore_EnumerableDebugView`1.get_Items()
You can bypass this problem if you enable UserPrivacyMode on the JiraClient level
// To be able to handle User Picker (multiple users) field type properly
jiraClient.RestClient.Settings.EnableUserPrivacyMode = true;
Thanks. This works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian.SDK 13 the same problem.
Always null reference exception after reading result after GetIssuesFromJqlAsync
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Needs a simple null check in MultiObjectCustomFieldValueSerializer. For personal use, I decompiled and added a single '?' to make it work. The project seems abandoned though since 2022...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.