Forums

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

How to get the QA name through field option in JQL?

GUMMADI VIJAYA Kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 26, 2018

As of now i am able to get the summary, description from my jql as follows:

https://companydomain/rest/api/2/issue/Key?fields=assignee,description,summary.

Now i need QA name and how to get it.I did not find any documentation in the fields also to get the QA name.Please help me.

1 answer

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2018

This REST call is technically not using JQL yet.  It's just a call to a specific single issue to return these specific system fields.  JQL is used for searching among Jira issues.  It's a small distinction to make, but I just wanted to clarify that part first.  

In the case of wanting to return specific custom fields when querying an issuekey, you will need to specify that field id when using this REST endpoint.  

I can see how this would be difficult to do, since calling that endpoint without specifying fields, will in fact return all the fields on that issue, but in that case it does not tell you the custom field id value.  To find that, you can actually make a GET call to the api/2/field first.  This returns a list of all the fields, but in that data, it also tells you the custom field value such as:

 {
    "id": "customfield_10200",
    "name": "text1",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
      "cf[10200]",
      "text1"
    ],
    "schema": {
      "type": "string",
      "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
      "customId": 10200
    }

In my test case, I have a custom field called 'text1', in turn this has an id of 10200.   With this information you can then return to your original call and specify the field id, such as:

/rest/api/2/issue/Key?fields=assignee,description,summary,customfield_10200

 

If you were using JQL, you would instead being using an endpoint such as /rest/api/2/search   In that case, the endpoint does not require you to use the field id, instead you can just use the name, 'text1' in my case, or 'QA' in yours presuming that this is a typical custom field in Jira.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events