I have a few custom fields in Jira that also has a description. These descriptions are the keys i will be using to send data to my application for processing using ScriptRunner script.
The description of the field is there in the UI as shown below:
But when i try to retrieve this description using the api, it returns null. Upon revieweing the docs of api, i found that the description field is not there which is causing null value. Is there any other API that I could use to returrn the value of description field?
This is the API I used earlier.
Hi Jamshaid,
I just tested and getting the custom field from the fields API does not return the description as Atlassian doesn't expose this to this endpoint.
However, the description is exposed to the Get Field Configuration Items endpoint.
This means you can make a get request using ScriptRunner for Jira Cloud to get the default field configuration scheme with the ID of 10000 like get('/rest/api/2/fieldconfiguration/10000/fields').
In the response here you will see the descriptions configured for custom fields.
I hope this helps.
Regards,
Kristian
Hey @Jamshaid
Have you tried to use the smartvalue {{issue.[Custom Field].description}}?
Following this doc Automation smart values - issues | Cloud automation Cloud | Atlassian Support this smartvalue should be enough for your case.
If you already tried this, please, let us know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Fernando Eugênio da Silva
I am working on it using script runner. I don't think smart values work in ScriptRunner scripts as it only works using Rest Apis.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to use this endpoint: https://your-site.atlassian.net/rest/api/2/field/search?id=customfield_XXXX
You gonna have only field details and also your description. See the result example:
Just need to use and response body indentation to get the specific description content.
REST API Documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-fields/#api-rest-api-2-field-search-get
Hope this helps you :)
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.