Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Retrieving the description of a custom field in Jira Cloud

Jamshaid
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2024

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:

 

 

Screenshot from 2024-08-27 13-41-42.png

 

 

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.

 

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Kristian Walker (Adaptavist)
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2024

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

 

0 votes
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 27, 2024

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.

Jamshaid
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2024

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.

 

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2024

@Jamshaid 

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:

Captura de tela 2024-08-28 111525.png

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 :)

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events