It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

863 views 7 0
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you