I am using the datacenter edition of JIRA (8.20.2) and its API and I have a customfield, customfield_10500 that can have one of multiple string values.
My problem is that I need to get the text value of the customfield, but I seem unable to get this information.
I have this data for a specific issue and the "customfield" returns an ID:
So I need the value of customfield ID 10620 - in my case it is the team name, e.g. "My Team 1".
It is my understanding that it should be possible to query the customfields by this direct API call:
.. but if I do this, then I get this 404 error:
Can anyone help me solving this problem? :-) I would really hate hardcoding these IDs in my code.
Hi @Dan Hansen Welcome to Atlassian Community!
It seems that you are trying to issue data, collecting custom field value of an existing issue.
Above code is for getting custom field context, one custom field have multiple context, jira admin create separate context for each project in which a custom field is used. This don't give the value of a custom field for an issue.
For getting a value for a custom field for an issue you need to check these links :-
Run GET in post function :-
https://jira.xyz.com/rest/api/2/search?jql=project=ABC&fields=customfield_22050,key'
It gives you value of a particular custom field not all custom fields value filled in an issue.
Solution :-
Kindly check following link for Advance Roadmap API :-
https://docs.atlassian.com/portfolio-for-jira-server/REST/2.13.0/teams/
This is Roadmap Team field, that's why not accessible like other Custom Field.
Thanks
V.Y
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.
This is the 3rd time I am replying here - it seems my replies are not saved?
This URL, "https://jira.xyz.com/rest/api/latest/search?jql=key=PRO21&fields=customfield_10500,key'" does not give the real value for the customfield - it merely limits the dataset and displays the exact same data (ID only) and does not expand its name value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to export the json result in csv file, It should give complete value inserted in a custom field. Let me add leaders to get correct solutions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't work with APIs much, but can you add .value to the end of the field?
customfield_10500.value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dan Hansen ,
thanks @Vikrant Yadav for involving me in this thread :)
You should use the following rest api https://docs.atlassian.com/software/jira/docs/api/REST/8.22.3/#issue-getIssue that will return a representation of issue in JSON format including all custom fields.
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John Funk - it looks like this without the value part - the customfield ID is visible but not the value:
But with the ".value" in the URL then it removes the customfield:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fabio Racobaldo _Herzum_ - I am already using this and it shows the output as within my original post. To show the entire thing then it is here (I have cut away some of the unnecessary stuff):
URL which will include all data scope (as I know it at least): https://jira.xy.com/rest/api/latest/issue/KEY-736?expand=renderedFields,names,schema,transitions,operations,editmeta,changelog,versionedRepresentations
If I then search for customfield_10500 then I get these results:
If I search for the actual team name that I can see is set on the issue, then I find it only visible in the CHANGELOG dataset (because I have tested it with some changes).
So the data seems not visible not even with the complete dataset?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dan Hansen Is it a single select list field or single line text field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vikrant Yadav - it is a single select list. There are several entries in the team list, but you can only select one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay , but postman is giving value/option id not exact value/option name, right ?
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.
@Dan Hansen I tested in postman following GET command and get custom field value selected for an issue, as you can see in the screenshot. I think you are looking for the same.
You can convert json result in csv or excel to see correct format or use Power query to fetch data in excel directly from jira.
https://jira.xyz.com/rest/api/2/search?jql=key=HBBPD-934&fields=customfield_36066,value'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dan Hansen As per the screenshots shared by you and after checking the field type ( com.atlassian.teams:rm-teams-custom-field-teams ) , it seems that it's Advanced Roadmap "Team" field. Please correct me if I am wrong.
If it's Roadmap "Team" field, kindly check workaround shared in following link :- I would like to have a rest API call that returns the issues' details with their respective Portfolio Teams name.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vikrant Yadav - yes, good spotted that we are using the JIRA Advanced Roadmap feature. I did not know the Team customfield was special for this?
The workaround does not help me much as I do not have access to the database - only via the standard API interface we have.
Also if I run the same query/URL as you have then it will still not show the value - only the ID:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dan Hansen I don’t think Roadmap Teams field is accessible via REST API.
@Fabio Racobaldo _Herzum_ Kindly suggest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dan Hansen Kindly check following link for Advance Roadmap API :-
https://docs.atlassian.com/portfolio-for-jira-server/REST/2.13.0/teams/
This is Roadmap Team field, that's why not accessible like other Custom Field.
Thanks
V.Y
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vikrant Yadav - great and this works (the blurred part is the actual team name)! :-)
If you don't mind creating your comment as an answer, then I will accept this as the answer.
I don't understand why this information is not available within the normal(?) data, but I assume it has something to do with this Roadmap functionality has been purchased and then not yet a fully integrated part of the native API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool! Glad to hear it works for you :)
I have added solution in my first comment, you can mark that as answer.
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.