Using REST, how can I update bulk issues on JIRA?

Hi,

Using JIRA 6.2.2 REST api (/rest/api/2/issue/bulk), I am currently able to create bulk issues for my test JIRA project.

However I could not find any information as to how to update existing issues (in bulk) using REST.

In my request (I pasted it below), I tried to set specific JIRA issue keys so that it would update existing issues but instead, it creates new set of issues while ignoring the issue keys that I tried to set.

Can anyone please help? Thank you!

{

"issueUpdates": [

{

"update": {},

"fields": {

"project": {

"name": "SR",

"key": "SR",

"issues": [

{

"key" : "SR-100"

}

]

},

"summary": "something's wrong",

"issuetype": {

"name": "Story"

},

"description": "something's wrong"

}

},

{

"update": {},

"fields": {

"project": {

"name": "SR",

"key": "SR",

"issues": [

{

"key" : "SR-200"

}

]

},

"summary": "something's very wrong",

"issuetype": {

"name": "Story"

},

"description": "something's very wrong"

}

}

]

}

2 answers

1 accepted

Accepted Answer
1 vote

If you know all the keys of the issues you want to change, why don't you just call /jira/rest/api/2/issue/{issueIdOrKey} with all those keys? If you use a skript you could just put it in a loop through all the keys and be done.

The /bulk method unfortunatly does not support PUT, so it won't allow the function you want to get. So if you really want to use a single call you only have the choices of looking for a plugin providing this function or maybe write your own extension to the Jira rest api

Thank you for your help! Updating by issue-key worked for me.

My only remaining question is, is it possible to create issues with specific issue-keys?

No, that is not possible. While there might be a dirty hack by going through the database directly, it would involve quite a lot of really sensitve code and your system admin would hate you for life.

If you just need to get the key of issues you just created, I think the rest api will return the key along some other data to you after you call a create, just like the IssueManager-class would return you an issue created through its interface

That's unfortunate but thank you for your help. I played around with JSON Importer and found out you can create issues with specific issue-keys so I may go that route. Again, thank you for your help!

using Bulk, what is the JSON format for Bulk issue creation, The document example just shows about updating issues not creating issues.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

22,362 views 2 7
Join discussion

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