Hey all, I couldn't find a better solution but I'd love to hear if anyone has a faster way of releasing multiple versions at once.
Problem: we had ~100 old Archived versions that were showing in our filters because they were also Unreleased.
Solution TL;DR:
Note: if the versions you're trying to release are Archived, they'd still show as Archived but have a Release Date and won't show when filtering for Unreleased.
The original base automation looked like this:
I added the "QQQ" to make it easier for me to spot where the remove the version
Getting a list of versions to release
If you have ScriptRunner:
def versions = get("/rest/api/2/project/${ProjectKey}/versions")
.header('Content-Type', 'application/json')
.asObject(List).body as List
3. Run it to get a list of versions and their status (released, archived, etc)
Adding additional Release Versions actions to the automation we've created at the start
1. Export the automation
2. Open the Json file (I used Xcode but it's possible Notepad will work as well)
3. Locate the block of code that's the Release Action. Should be after the first mentioning of "components" and before "canOtherRuleTrigger"
4. Duplicate the block of text and change the version name each time to a version from your list. There are several ways to make this quicker, like in excel or Google Sheet:
I used basic beginner C++:
note: the names of my versions where numbers. Otherwise use vector <string>
note#2: use C++ string converter to convert the Json code from the automation to a string with no errors.
#include <iostream>
#include <vector>
using namespace std;
vector <int>number{1, 2, 3} //the list of your versions
string part_1 = "{\"id\":\"476443792\",\"component\":\"ACTION\",\"parentId\":null,\"conditionParentId\":null,\"schemaVersion\":1,\"type\":\"jira.version.release\",\"value\":{\"versionName\":\"";
string part_2 = "\",\"releaseDate\":null,\"overrideReleaseDate\":\"ALWAYS_OVERRIDE\",\"project\":{\"type\":\"ID\",\"value\":\"YOUR PROJECT NUMBER\",\"additional\":\"software\"}},\"children\":[],\"conditions\":[],\"connectionId\":null},"; //note that this code needs YOUR project number
int main()
{for (int i=0;i < number.size();i++)
{ cout<<part_1<<number.at(i)<<part_2<<endl; } } //note: the last block of code created with have a "," at the end that needs to be removed
Update the Json file
Run the newly created automation
The new automation should look like the old one but with multiple components to release a version.
Run it!
Note if you're releasing archived versions:
On the Release they will still show as Archived by they have a Release Date and shouldn't show up when filtering for Unreleased.
I think you could just move all the issues to a single release via bulk update and release them.
The issue was that the versions were appearing in the Fix Version drop down on a ticket and could get tickets re-added to them.
So I wanted the versions hidden to users.
Does your suggestion still apply in that case?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.