Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

URL is not working for rest api for my company

Mehmet Sahan October 6, 2022

Hello, 

I have a personal Jira account and its url is like https://xxxxxxxx.atlassian.net/ and I am able to fetch data by python rest api but I am not able to do so for my company account with the same way.  Thank you

 

import requests
from requests.auth import HTTPBasicAuth
import json
import pandas as pd
from tabulate import tabulate
import sys
#Personal
auth1 = HTTPBasicAuth("email",
                    "ABCDEFGHJHKHKJHJKHJK")
#Company
auth2 = HTTPBasicAuth("email",
                    "JHJKHJKHJHJKLUIHHJG78778TTYUGGJHGJHGJ")

headers = {
    "Accept": "application/json"
}
query1 = {
    'jql': 'project =IT'
}
query2 = {
    'jql': 'projects =CASAAUTOMIT'
 
}

response1 = requests.request(
    "GET",
    url1,
    headers=headers,
    auth=auth1,
    params=query1
)

response2 = requests.request(
    "GET",
    url2,
    headers=headers,
    auth=auth2,
    params=query2
)

print(response1.status_code)
print(response2.status_code)

0 answers

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