Jira rest api search throwing 401 error

Hi,
I am trying to call search url using jwt authentication. Endpoint is working fine without jql. But I am getting 401 error whenever I am trying to call with jql . Here is the url I am trying to access https://xxx.atlassian.net/rest/api/2/search?jql=updated <= -3d .

could someone help me on this?

Can you add the details of the HTTP 401 response? At-least the payload?

This url is giving 401 error /rest/api/2/search?jql%3D%20assignee%20%3D%20sbonagiri
but “/rest/api/2/search” is working fine

PayLoad details
{[qsh, 25a98c36f7c2579e07f495f2c82534822a08e0903180e1ec78278f13a0574693]}
{[iss, com.xxx.JIRAIntegrations]}
{[iat, 1510628797]}
{[exp, 1510632397]}

following is response data
response.StatusCode Unauthorized System.Net.HttpStatusCode
response.ReasonPhrase “Unauthorized” string

Right. :slight_smile: Can you now provide what scopes you have requested in your Atlassian Connect descriptor? It may be related. Though I would have imagined that a 403 would have been thrown instead.

I have provided admin access in addon.
I have narrowed down problem to some extent
Following url is not working
https://factset.atlassian.net/rest/api/2/search?jql=updated>="-12h"%26startAt%3D1%26maxResults%3D100

But following one is working
https://factset.atlassian.net/rest/api/2/search?jql=updated>="-12h"&startAt=1&maxResults=100

All I did was encoded the url. Could you explain me the difference between both and provide a way to fix this?

Because the entire query string is encoded in the first example, Jira thinks that your JQL query is updated>="-12h"&startAt=1&maxResults=100 - ie you should not encode the & and = in the query string between query string parameters and their values.

1 Like