How to add some new "issue types" to issue-type-scheme via rest api ?

Dmitrii July 17, 2021

I need to add several new "issue types" to the existing schema. I can't find the method I need through rest-api.

3 answers

1 accepted

0 votes
Answer accepted
Txus
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 17, 2021

Hi!!!

This is the method that you are looking for if you are using Jira on Cloud.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-schemes/#api-rest-api-3-issuetypescheme-issuetypeschemeid-issuetype-put

But if you are using Jira Server/Data Center this method doesn’t exist.
You must follow the next flow by api rest:

https://docs.atlassian.com/software/jira/docs/api/REST/8.13.9/

1. Get the issuetypes of the project.

2. Create a new issuetype scheme with the issuetypes that you have got plus the new ones that you want to add.

3. Associate the new issuetype scheme with the project.

4. Delete the old issuetype scheme if you can and want to.

I hope I have helped you.

Best Regards

Txus

0 votes
Anilkumar November 2, 2022

We followed below for adding issue type in issue type schema via REST API but it's not working and showing error (HTTP Status 405 – Method Not Allowed)

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-schemes/#api-rest-api-3-issuetypescheme-issuetypeschemeid-issuetype-put

 

https://docs.atlassian.com/software/jira/docs/api/REST/8.13.9/

We are getting below error while following
PUT method  https://domain/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype

Body :{ "issueTypeIds": [ "10000", "10002", "10003" ] }

Error we getting is

<!doctype html>
<html lang="en">

<head>
<title>HTTP Status 405 – Method Not Allowed</title>
<style type="text/css">
body {
font-family: Tahoma, Arial, sans-serif;
}

h1,
h2,
h3,
b {
color: white;
background-color: #525D76;
}

h1 {
font-size: 22px;
}

h2 {
font-size: 16px;
}

h3 {
font-size: 14px;
}

p {
font-size: 12px;
}

a {
color: black;
}

.line {
height: 1px;
background-color: #525D76;
border: none;
}
</style>
</head>

<body>
<h1>HTTP Status 405 – Method Not Allowed</h1>
<hr class="line" />
<p><b>Type</b> Status Report</p>
<p><b>Description</b> The method received in the request-line is known by the origin server but not supported by the
target resource.</p>
<hr class="line" />
<h3>Apache Tomcat/8.5.81</h3>
</body>

</html>
0 votes
Dave Bosman _Realdolmen_
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.
July 17, 2021

Hi @Dmitrii 

I think this is what you are looking for 

Regards

Dave

Anilkumar November 3, 2022

I followed below curl call but still showing an error

PUT    https://domainname/rest/api/2/issuetypescheme/issuetypeschemeID

Body :

{
"name": "issue type name",
"description": "Anil adding issue types through REST API",
"issueTypeIds": [
"12300"
]
}


ERROR is
{
"errorMessages": [
"Cannot update IssueTypeScheme because an IssueType migration would be required."
],
"errors": {}
}

Suggest an answer

Log in or Sign up to answer