Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I am using python jira api GET /rest/api/3/issuetypescheme/project but i am getting error

chaitali k October 15, 2020

I am using below code

url = "https://{domain_name}/rest/api/latest/issuetypescheme/project"

auth = HTTPBasicAuth('username', 'password')

headers = {
"Accept": "application/json"
}

query = {
'projectId': 'project_id'
}

response = requests.request(
"GET",
url,
headers=headers,
params=query,
auth=auth
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

 

 

 i am getting below error 

{
"errorMessages": [
"not a valid scheme id: project"
],
"errors": {}
}

2 answers

2 accepted

1 vote
Answer accepted
Mark Ahnell
Contributor
October 16, 2020

@Niranjan , I've been googlin around for this forever and never saw the /associations documented anywhere and it works!  Thanks you!

@chaitali k , knowing what Niranjan just showed us, here is how I am going to approach the same issue you are having.

  1. Call /rest/api/2/issuetypescheme
    • Returns a list of all Issue Type Schemes
  2. For each Issue Type Scheme, call /rest/api/2/issuetypescheme/{schemeId}/associations
    • Returns all Projects for that Issue Type Scheme
  3. For each Project that is returned, look for the Project you're looking for. When you find it, exit both loops

If I was calling a Jira Cloud instance, it would be much easier, but this is the only way I see to do it.  If anyone knows of a better way (using version 2 API), please comment.

chaitali k October 16, 2020

yes I tried this but its taking lot of time to run python script.

that's why i need another way to do that.

1 vote
Answer accepted
Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2020

Hi @chaitali k ,

Could you use this restapi call as url /rest/api/2/issuetypescheme/. ? This call should list all issue types schemes in the instance. /rest/api/2/issuetypescheme/schemeid will give the project associated with the scheme.

Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2020

/rest/api/2/issuetypescheme/{schemeId}/associations - This call should give you the associated projects (provided you give the scheme ID)

chaitali k October 16, 2020

thank you for your help.

I need to find issuetypescheme associate to that project using projectid/projectkey

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events