Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL query to get custom fieds

skrish June 7, 2020

Hi ,

I am trying to get custom fields using my jql query and have tried various options mentioned on this site like

https://community.atlassian.com/t5/Answers-Developer-Questions/JQL-query-to-pull-custom-fields/qaq-p/507920

and using cf[10021] syntax etc... but i get an 'invalid glob at..." error.

does anyone know what i might be doing wrong? need to get just one custom field. should i use the actual title of the custom field. i did a get on a specific jira item and verified the field i am retreiving is titled "ticket number" but has the id customfield_10021. also jira seems to return lots of other filds that i am not requesting like avatar, icn color  etc... how do i get rid of these? i am only requesting id, assignee and status fields along with the custom field

also the title of the custom field has a '/' in it (like "ticket/ID"), so i am guessing will need to escape it with a '\' if i should be using the title instead...? 


appreciate the assist. 

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
June 8, 2020

JQL doesn't return fields, it just gives you a list of issues that match your question.  You have to look at what you're using to read out the issue data and tell that what you want.

Take a look at https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/ and look for the section "Searching for issues and restricting the issue fields returned in the results"

It also shows you how to name the fields in your queries.

skrish June 11, 2020

i was able to get the custom fields using the POST example at the link above

0 votes
skrish June 7, 2020

.

Suggest an answer

Log in or Sign up to answer