Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Creates Jira a new issue when the ID isn't found?

Maurice Gerhardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2018

I want to update multiple issues with one api call. Sometimes there is a new issue in the csv file without a JIRA ID. In this case I want that JIRA creates a new issue. Is this possible, or is Jira doing it automatically?

I will appreciate any suggestions

Thank you all

1 answer

1 accepted

1 vote
Answer accepted
Matias Stachowski
Contributor
July 27, 2018

As far as I know, there is no feature that will automatically create an issue if you try to edit a non-existent issue.

I think you should simply just iterate over each issue in your csv:

Issue issue = getIssue(id);
if (issue != null) {
updateIssue(issue,data);
} else {
createIssue(data);
}

The only problem you may face is that the issue keys that Jira will auto-generate for you will differ from the ones in your csv, as you cannot control the key generation.

If you need some sort of sanity check to compare the issues in the csv with the Jira instance, you can save the keys from the issues you create in a map, mapping to the keys or ID's from the csv.

Maurice Gerhardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 29, 2018

Thanks a lot. I'll test it later this week.

Suggest an answer

Log in or Sign up to answer