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

ray park April 9, 2014

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

2 votes
Answer accepted
Marten Kreienbrock
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.
April 11, 2014

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

ray park April 16, 2014

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?

Marten Kreienbrock
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.
April 16, 2014

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

ray park April 16, 2014

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!

1 vote
arunicsbit July 17, 2015

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