Bulk delete versions?

FogBugz has two version fields per issue, the "fix for" version and the "seen in" version. When importing from FogBugz, JIRA adds all of the values from both fields to its list of versions. Because we include build numbers in the "seen in" version (e.g., 5.0.9864), the JIRA database has nearly 1,000 versions in its list. Only about 20 of these are real, assignable versions (e.g., "5.0").

How can I get rid of all the unassignable versions without having to delete them one by one, which will take forever?

1 answer

The only way I can think of is to delete them via a loop script that calls the JIRA API endpoint for "deleting a version". I have the JIRACLI tool so I can just run the following in a loop

jira --action deleteVersion --project "zjiracli" --version "auto1")

Reference: https://bobswift.atlassian.net/wiki/display/JCLIP/Documentation

Or you can just create your own script to loop through the JIRA API Delete Version endpoint

Reference: https://docs.atlassian.com/jira/REST/latest/#api/2/version-delete

Thanks. We don't have a JiraCLI license (although it sounds useful–I'll agitate to get one). I've been trying to delete versions using the REST API without much success. Here's an example URL:

https://foobar.atlassian.net/rest/api/2/version/12808

where "12808" is the JIRA ID of one of the versions I want to delete. This looks right to me, according to the REST docs. But it returns 404, "NOT FOUND".

Do you see what I'm doing wrong?

One thing that bothers me is that there's no indication of the project ID. Could this be the problem?

Can you try doing a "get" first? Also, does your account have the correct permission to delete versions?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot