Awkward solution for releasing multiple versions at once.

Rony Kahana June 26, 2024

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:

  1. Create an automation: 
    1. Trigger: Scheduled
    2. Action: Release Version (check the overwrite date box)
  2. Export the automation 
  3. Open the Json file (I used Xcode) 
  4. Duplicate the Release Action code block
  5. Replace the Version number in the code block with one of the versions you want to release
  6. Repeat #4 and #5 for all the versions you want to release
  7. Make sure the code after the last component is the same as it was originally (it shouldn't have changed just moved down)
  8. Import the new Json file
  9. Run the new automation 

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. 


Same solution - but the long version: 

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: 

  1. Create a new Scheduled job
  2. Copy paste the code to get a list of versions from here adding your project code 
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:

  1. Identify where in the block of code the version name goes
  2. Place the first part of the code (before the version name) in column A, the version name in column B, and the last part of the code in column C.
  3. Copy A and C as is all the way down and column B should be all the version names
  4. Use COCAT or & to combine them and copy the result from column C. 

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 

  1. I removed the last "," from the generated blocks of code, and pasted them in original Json file right after the first block ends (\"connectionId\":null}) keeping the rest of the code as is. 
  2. Saved the Json file
  3. Jira > Automation > Import
  4. Choose the modified 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. 

1 answer

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2025

@Rony Kahana 

I think you could just move all the issues to a single release via bulk update and release them.

Rony Kahana January 15, 2025

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?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events