JQL query does not return 'comment' field- JIRA Cloud REST API

rest-api
jira-cloud

#1

Hello, I am having trouble trying to understand why the jql query I am using to get issue information from JIRA returns issues with ‘comment’ field absent in the response.
The REST API call is
https://<MY_DOMAIN>/rest/api/2/search?jql=project=<PROJECT_KEY>%20AND%20issue=<ISSUE_KEY>

I get the json response but the comment field in missing. Please help


#2

Hi @manosree,

Have you tried this:

https://<host-name>.atlassian.net/rest/api/2/search?jql=project%20%3D%20DEV&fields=comment

Cheers,
Anne Calantog


#3

Thanks that works, but is there no way of getting all the fields without needing to provide each field’s name. Just curious


#4

Hi @manosree,

In the search API, only “navigable” fields are returned by default. This means certain fields that can have multiple entries, like comment and worklog need to be specified directly. See the documentation for more info: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-search-get


#5

Thanks for the information. Cheers


#6

Additionally, if you don’t specify fields explicitly your search queries will respond measurably slower.


#7

Hi dmeyer, I am experiencing the same issue as well whereby my jql query returns issues with ‘comment’ field absent in the response results. How can I specify the comment to be included in my jql query response ?