Hello,
I use rest API (/rest/api/2/issue/IssueKey) to fetch issues from Jira like the following example:
problem:
"key": "FF-120",
"fields": {
"resolution": "Pending",
"customfield_11792": "Need review",
}
I define the custom field name as "current phase", but when I fetch it using API, the key (id) of the custom field appear as customfield_xxxxx NOT "current phase", how to fix it?
I need to be like that:
"key": "FF-120",
"fields": {
"resolution": "Pending",
"current phase": "Need review",
}
This is an example, and I have many custom fields.
Kindly I'm looking for your support.
There is nothing to 'fix'. The REST API is working exactly as it should.
The ID for custom fields is always in the format "customfield_xxxxx", not plain words, like the built-in fields.
Many thanks for your response.
But in case using issue rest API. I just received customfield_xxxxx without any meaning instead of using a key name for example: current phase.
Based on your experience how do you deal with this situation? and Is there a walkaround?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but I still don't quite understand what you're asking for. Every field has the characteristics ID and Name:
Your query to /rest/api/2/field returned exactly what it was supposed to.... information about a custom field with the ID "customfield_11792" that has the Name "current phase". The field's Name is right there.
I get a feeling you want the IDs of custom fields to come back in the same way as Jira's built-in fields, such as the built-in field that has the Name "Issue Type" and has the ID "issuetype" . That's not possible; Jira's built-in fields are the only ones that have 'plain words' as IDs
If you're asking for how to 'fix' Jira by adding an new attribute called 'custom' with a true / false value for every single field, then that's a feature request you'll have to make to Atlassian. Personally, I think they'll say much like I have... if you want to know if a field is a built-in one or a custom one, just look at the ID; if the ID starts with "customfield_" then you know it's a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I investigate in the custom fields API (/rest/api/2/field), I found in the following:
Current:
{
"id": "customfield_11792",
"name": "current phase",
......
],
I need to be like that to be fixed when I fetch the issues using rest API
{
"id": "current phase",
"name": "current phase",
"custom": true,
]
Any ideas on how to fix it?
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.