Hi, I am working on a JIRA rest API, which would need the data of an issue, I have added custom fields to my project, but my JSON would not return the name of the custom fields, instead I get it with ID. Is there a way I can query it to return the name instead of custom field ID.
using: GET : https://abc.xyz.com/rest/api/2/search?jql=project=xyz
and here is my part of response for 1 field
"issues": [
{
"expand": "operations,editmeta,changelog,transitions,renderedFields",
"id": "894189",
"self": "https://abc.xyz/rest/api/2/issue/894176",
"key": "xyz-6",
"fields": {
"customfield_12010": null,
"customfield_10351": null,
"fixVersions": [],
"customfield_10111": null,
"resolution": null,
"customfield_10112": null,
"customfield_10355": null,
"customfield_10225": null,
"customfield_12921": {
"self": "https://abc.xyz.com/rest/api/2/customFieldOption/12905",
"value": "abc",
"id": "12965"
},
]
In my project customfield_12921 is names as Type on front end. And I would like to use the fields with names instead of Id's as when I move this my prod instance the id changes and I would need to make the changes again.
Appreciate your help.
I think you would need to write a program. You could defince field ids programatically and construct your rest call. You can find more info about getting all fiedls with ids and names here:
https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-field-get
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.