Which are the possible cases of HTTP status code 400 for the search issue API with the correct jql

AutomationUIUser November 1, 2023
Hi,
 
We've encountered problems with the following scenario:
  • Making a POST request to rest/api/3/search.
  • The request body contains {jql: "id in (1,2,3)"}.
  • This request occasionally works, but sometimes it fails with a 400 error. Could you please help us understand the likely reason for this inconsistency?
Furthermore, we haven't specified any sorting order in the JQL. Does this omission affect pagination in any way? And what is the default sort order when order by is not defined in the request?

 

1 answer

0 votes
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2023

Hi @AutomationUIUser ,

Seems like you've posted the same question twice https://community.atlassian.com/t5/Removed-Posts/400-bad-request-in-search-api-on-correct-jql/td-p/2521825#U2522011

Perhaps you can mark the answer in that thread and mark this one as "Accepted" so that we can keep only one thread open.

AutomationUIUser November 1, 2023

I am not able to access this post

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 2, 2023

Hi @AutomationUIUser ,

The previous post was removed/archived, adding the answer back here:

When using the POST /rest/api/3/search api, you need to add backslashes to the double quotes, else the tool will assume those as the quotes used during the API call, adding a screenshot below of how I use it in Postman :

image.png

AutomationUIUser November 3, 2023

Hi,

 

Our query does not involve the double quotes

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 3, 2023

Can you share an image of the actual query and body?

Will try to reproduce it at my end then.

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2023

Hi @AutomationUIUser ,

I just noticed that you used the below in your body (as per the main query): 

 {jql: "id in (1,2,3)"}

you will have to put the key in double quotes, correct query is as below :

{
    "jql": "id in (1,2,3)"
}

 

Do let us know if the this helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events