how to request for search ticket using jql and using the accounid for authentication in python

Naresh Gundu June 17, 2019

Below get is now working and getting 401 error code.


Filter-result = requests.get("https://xyz.atlassian.net/rest/api/2/search?jql=project ="+filterproject+" AND status = 'VERIFY' AND issuetype = 'Bug'&maxResults=1500",auth=(accountid), headers=headers)

 

Filter-result status: 401

please provide me the correct syntax which fixes above error.

 

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2019

EDIT:

I have found a support request opened by you for the same topic and I can see that it was solved by using an API Token instead of the password to authenticate your calls.

I believe the below reply is not needed anymore. Let me know if this is wrong :) 

 

 

Hi @Naresh Gundu ,

The status/error code 401 means that you are  not authorized to execute the call.

Now, can you kindly let us know:

  1. How are you authenticating the REST API request? Are you using an API Token or anything else?
  2. Have you tried to execute the same call using curl and the same credentials? Does it work? Can you copy paste the output in here like below example?
    curl -D- -u xxxxxxx@atlassian.com:API-TOKEN -H "Accept: application/json" -H "Content-Type: application/json" https://xxxxxxx.atlassian.net/rest/api/2/search?jql=project%3DTSMN%20AND%20issuetype%3DBug

    HTTP/2 200
    server: AtlassianProxy/1.15.8.1
    vary: Accept-Encoding
    ...
    [removed]
    ...

    {"expand":"schema,names",
    "startAt":0,
    "maxResults":50,
    "total":6,
    "issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"10513",......
    ...
     

Please let us know.

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer