Hi,
Is there any way to retrieve all fields including comments in results using post search rest api?
POST /rest/api/2/search
Hi,
Is there any way to retrieve all fields including comments in results using post search rest api?
POST /rest/api/2/search
Hi @sbonagiri,
Iâm not sure if this is possible. I tried testing without providing the fields in the payload and I got most of the fields except for the comment. If you want to get the comment, your request should look something like this like this:
{
"jql": "",
"startAt": 0,
"maxResults": 20,
"fields": [
"comment"
]
}
Cheers,
Anne
Hi @sbonagiri,
On the Jira search POST method, to pull down all fields in the search results, including comments, you can use:
{ "jql": "", "startAt": 0, "maxResults": 20, "fields": [ "*all" ] }
âŠbut thatâs a pretty heavy-handed call (meaning the payload can be huge). I would follow @acalantogâs example, with just comment
and then add more field values to the array â just cherry picking the ones you need. For instance, if you just need comments and summary, then youâd use something like:
{ "jql": "", "startAt": 0, "maxResults": 20, "fields": [ "comment", "summary" ] }
The default values field value is *navigable
. More info on how to use fields, see: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-search-get
Thanks,
Neil
Thanks!! That worked for me. I will not use unless there is on other option
What value should I provide for âjqlâ? I am giving the below json string. submitted using POST method.
data = â{ âjqlâ: [âupdatedâ>=â2020/07/02 10:09â and project=YYY], âstartAtâ: 0, âmaxResultsâ: 20, âfieldsâ: [âkeyâ, âcommentâ, âsummaryâ ] }â
Getting Error Message:
{âerrorMessagesâ: [âCan not instantiate value of type [simple type, class com.atlassian.jira.rest.v2.issue.IssueUpdateBean] from JSON String; no single-String constructor/factory methodâ]}