Hello, I’m using the Jira Cloud REST API /rest/api/3/search/jql and constructed the payload as per the documentation:
{
"queries": [
{
"query": "assignee IN (\"accountId\") AND statusCategory IN (\"To Do\",\"In Progress\")",
"startAt": 0,
"maxResults": 50,
"fields": ["assignee","summary","status","updated"]
}
]
}
However, the API returns a 400 “Invalid request payload” error.
Does /search/jql not support the fields
property? How should I correctly specify the fields to be returned?
Hi @Sandy Hsieh
Thank you for your question.
The payload has not a valid format.
The body, using the POST request of /rest/api/3/search/jql should be more similar to:
{
"fields": [ "assignee","summary","status","updated"],
"fieldsByKeys": false,
"jql": "assignee IN (\"accountId\") AND statusCategory IN (\"To Do\",\"In Progress\")",
"maxResults": 50,
"nextPageToken": "<string>",
}
The "nextPageToken" is used for pagination. You can find detail doc here
I hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sandy Hsieh
it seems ok. You are not managing the pagination, this call get only the first result page, if there is more results, you should manage a while in your code until the nextPageToken is empty.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sandy Hsieh ,
Please consider to mark this question as replied to help further users, thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.