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

This widget could not be displayed.

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!

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 16 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

42 views 1 0
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