How to change issue's parent via JIRA REST API?

I've tried this but this does not work:

 

 

var issueData = {
"update": {
"parent" : {
"key": "TES-1"
}
}
};
 

AP.require('request', function(request) {
request({
url: '/rest/api/2/issue/TES-12',
// adjust to a POST instead of a GET
type: 'PUT',
data: JSON.stringify(issueData),
success: function(response) {
// convert the string response to JSON
response = JSON.parse(response);
// dump out the response to the console
console.log(response);
dialog.close();

},
error: function() {
console.log(arguments);
},
// inform the server what type of data is in the body of the HTTP POST
contentType: "application/json"
});
});

 

 

 

Thanks a lot!

1 answer

You cannot change the parent through the REST API. If you need automation, you can use browser automation (e.g. Selenium) or write a script with Script Runner and expose a REST endpoint.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 2 hours ago in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

13 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you