Automatically release a version

Aftab_Akhtar December 28, 2023

Hi, 

I am looking to create a rule that would do two things. 

1. Automatically release a version at the end of the month. 

Issue: I have a release date against this version and it has not released it. 

Screenshot 2023-12-28 170753.png

i have set this rule up. however it does not seem to be working. 

Screenshot 2023-12-28 171121.png

2. Automate a creation of a new release once point 1 has been actioned.

my version numbering is 24.1--> 24.2 ---24.3 and I want it to go to 30.1 if possible. 

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 28, 2023

Hi @Aftab_Akhtar 

Your rule's trigger is for "Version Unreleased", but you describe releasing on a schedule.  Perhaps try the Scheduled trigger instead: https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Scheduled

For your second part of creating a new version, based on the name of version just released, the rule would need to:

  • somehow capture the version about to be released (using either Lookup Issues with JQL or a call to the REST API with the Send Web Request action)
  • extract and increment the version number (There are several questions in the community about how to do this.  Essentially using text and math expressions.)
  • Create the new version with the new name

 

Kind regards,
Bill

Aftab_Akhtar March 25, 2024

Hi @Bill Sheboy 

I hope you are well. I hope you can help me with this. 

There are two things I am trying to achieve. 

1. I want to close a release with a rule. I have set up the below rule and it has not seemed to work.

release version 1.png

The below screenshot are the release versions the rule is working against. I was expecting 23.12 to be released.

release version 2.png

 

2.  I want to then create a new version based on the last released version 

point 2.png

version name: {{version.name.substringBeforelast(".")}}. {{#=}} {{version.name.substringAfterLast(".")}}+1{{/}}

 

Where am I going wrong and what would I need to change? any help is appreciated. 

 

thanks 

Af

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2024

Hi @Aftab_Akhtar 

With your first rule, it seems you want to release the next version.  And so the scheduled trigger should have no JQL as the Release Version action will release the next version, by default.  There are additional things under "More Options" if you want to adjust that behavior.

 

With your second rule, you want the action of the first rule (i.e., releasing the version) to trigger the second one. 

By default, the actions of one rule cannot trigger another rule.  This is to prevent errors and run-away looping.  For your scenario, you want this triggering to happen, and so in the details at the top of the second rule, enable the "Allow Rule Trigger" option: https://support.atlassian.com/cloud-automation/docs/create-and-edit-jira-automation-rules/#Edit-the-details-of-a-rule

 

Kind regards,
Bill

Aftab_Akhtar October 3, 2024

Hi @Bill Sheboy 

With your help earlier this year, i created a rule using the script below. it creats a new version for me from the last version by adding +1 after the point. 

eg.

released version = 24.1

new version = 24.2

{{version.name.substringBeforelast(".")}}. {{#=}} {{version.name.substringAfterLast(".")}}+1{{/}}

I want to enhance this script even further. 

so once it reaches .12 then it also adds +1 before the decimal point and restarts back to 1 after the decimal point. 

24.12->25.1

25.12 -> 26.1

26.12 -> 27.1

How would i do this? 

thanks 

Af

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2024

Hi @Aftab_Akhtar 

When you want to increment multiple parts of the version number, you will need to implement the math using if / else conditions on the separate parts. 

For example, assuming your format of 24.1 as part of the version name:

  • action: create a variable for the left part (e.g., 24) using text functions
    • let's name that varVersionMajor
  • action: create a variable for the right part (e.g., 1) incremented to the next number (e.g. 2), as you did earlier
    • let's name that varVersionMinor
  • if / else condition
    • use a smart values condition to check if {{varVersionMinor}} equals 13
      • action: recreate varVersionMajor, incrementing the value
      • action: recreate varVersionMinor, setting it to 1
  • after the condition, now the to parts may be used together:
    • {{varMajorVersion}}.{{varMinorVersion}}

 

Kind regards,
Bill

Aftab_Akhtar December 27, 2024

Hi Bill, thank you for your reply. Apologies, i am not the best at this. Appreciate, if this is something you can add on top of my script please?

I tried a few different things but could not get it to work. 

Thanks 

Af

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 27, 2024

What have you tried for the suggestions I provided?  

If you have updated your rule and it is not working as expected, please post:

  • an image of the updated, complete rule in one single image
  • images of each rule action and condition
  • an image showing the audit log details for the rule execution
  • explain exactly what is not working as expected

 

Please note the Atlassian Community is a place for people to learn and collaborate with each other.  It is not free labor to implement rule requests, and we do not have access to your Jira instance to make changes directly. 

If you are unable to implement the suggestions please work with your Jira Site admin so they may help you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events