Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Field value missing when using GetCustomFieldAsync

Chrysanthi Lagodimou July 28, 2021

Hello

We try to import the backlog of a project hosted in jira cloud. The project has defined 'Sprint' as a custom field. When we export the backlog we get two csv columns with the header 'Sprint'. That is because a story can be implemented in more than one sprints.

The issue is that when we try to import the backlog through a .net backend, using the Atlassian.SDK nugget package and more specifically the _jiraClient.Fields.GetCustomFieldAsync() method, the custom field sprint has no value.

And the jql is:
project = "project-name-goes-here" AND type in (Story, Bug, Epic) AND resolution is EMPTY AND (Sprint is not EMPTY OR Sprint not in openSprints())

image.png

What could be a reason for this?

Thank you very much!

2 answers

1 accepted

0 votes
Answer accepted
Chrysanthi Lagodimou August 5, 2021

That worked for me:

var sprint = issue.CustomFields.GetAs<JArray>("Sprint");

var sprintName = sprint.FirstOrDefault()?.Value<JToken>("name").ToString();

Source: https://searchcode.com/file/128952287/Atlassian.Jira/CustomFieldValueCollection.cs/

0 votes
Chrysanthi Lagodimou July 30, 2021

Follow up

At this point is maybe more of a c# question...
image.png
I am trying to access the name of a Sprint of a Jira Issue. The custom field sprint is null but the value I need exists in the Non-Public members. I am interested in accessing the name of the Sprint. I have tried to use Reflection, but I am probably doing something wrong because I always get null. Can someone please help? Thank you!

Suggest an answer

Log in or Sign up to answer