Reputation: 97
I am completely new in JIRA system. For some development purpose I need to use some JIRA REST APIs. Please see an example of the API below:
https://jira.sw.abcd.com/rest/api/2/search?jql=xyz%abcd%efg%12345%20
Now when I hit an API from browser (e.g. Chrome) I get the result perfectly. But when I try to hit via Postman it's giving me the following message with status code
400 bad request
{
"errorMessages": [
"The value 'abcd' does not exist for the field 'xyz'."
],
"errors": {}
}
I searched and found that I need authorization. So I provided my username and password in the
"Authorization" section where the type is "Basic Auth"
But still the same error message. What am I doing wrong?
Upvotes: 0
Views: 2293
Reputation: 16
I believe Postman may be transferring your JQL a little bit different than what you are expecting.
Checking the JIRA REST API documentation:
It's possible to see that most of the examples are using "=" signs in the query params of the URL.
So JIRA would be expecting you to send something like this:
http://kelpie9:8081/rest/api/2/search?jql=assignee=fred
Note that the query params do accept the = sign after the jql.
So first step would be to sort out the JQL you want to use and put it as it is in the query string.
Additionally, the document offers the option to use a POST where you can specify in the payload the JQL you want:
Upvotes: 0