Jira Automation: Creating a fix Version with appropriate name

Danielle Bonneau April 28, 2020

Has anyone successfully created Automation within a Jira Project to create a fix Version with the appropriate fixVersion name?

What I would like to do is, when a version is released, the next version is automatically created.

For Example: Release 3.2.1 -> Jira Automation automatically creates 3.2.2

What I am finding is that it cannot do the math correctly in incrementing the value.

I have tried {{#=}}{{version.name}} + 1{{/}} and {{#=}}{{version.name}} + 0.0.1{{/}} and several other variations and I keep getting this error: "Error rendering smart-values when executing this rule:null: 3.2.1 + 0.0.1"

Any help would be greatly appreciated!

2 answers

1 accepted

4 votes
Answer accepted
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.
April 29, 2020

HI @Danielle Bonneau 

I believe the format of the version number you are using is text, and not a number, due to the multiple decimal points/periods. 

Have you tried to split the value apart, increment the last value, and then concatenate back together for the new value?

Best regards,

Bill

Danielle Bonneau April 29, 2020

Hi Bill,

Thank you for your response! That makes sense that it would be a text vs a number.  I thought I might have to figure out something fancy with splitting, incrementing, and concatenating but I haven't gotten far enough along to figure out how to do that. 

If you have any examples so share I'd really appreciate it!

 

Thanks again,

 

Danielle

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.
April 29, 2020

Hi Danielle,

I made a quick attempt to capture a released version, split it, increment, and reassemble... but I ran into a couple of hurdles:

  • First thing, the released version provided from the webhookData is not the complete version record , it is something that appears to be the name only...
  • Which would be fine, if the Split function could parse it. Instead it returns the whole thing or empty string. I have found other community member posts asking about issues getting Split to work as documented.

I posted another question about finding more documentation on automation webhookData, so let's see what others provide.  The original source from the company who built the automation, Code Barrel, was sunset when Atlassian acquired them in October, so no help there.

In the meantime, if you figure this out, please post your solution.  Thanks!

Danielle Bonneau April 29, 2020

I appreciate you giving this a shot Bill!  I will attempt to play around with it some more.

 

Thanks again!

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.
April 29, 2020

Just in time... I figured it out: create a rule that triggers on version released, action is to create a new version, with this value:

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

This works by the following:

  • Take everything before the last period,
  • Add back in a period,
  • Take everything after the last period, and increment it

 

Some things I learned along the way

 

Best regards,

Bill

Like Kalos Bonasia likes this
Danielle Bonneau April 30, 2020

Hey Bill,

 

Just gave it a try and it worked like a dream! Thank you so much!  

Do you happen to know if there is a way to have that release automatically go to the bottom of the version list (becoming the earliestUnreleasedVersion)? That would just be a bonus - what you provided is so helpful!

Thanks again!

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.
April 30, 2020

Hi Danielle,

I am glad that helped.  Please consider marking this one as a solution so others can find it later.

Regarding the version ordering, it seems people have been asking for this feature in the suggestions.  Please take a look at the items in this backlog search to see if any of the ideas would help as some of them include work-arounds.

https://jira.atlassian.com/issues/?jql=project%20IN%20(JRACLOUD%2C%20JSWCLOUD)%20AND%20resolution%20%3D%20Unresolved%20AND%20summary%20~%20version%20AND%20summary%20~%20sort%20ORDER%20BY%20Key

 

Best regards,

Bill

Raju Mandapaka May 6, 2021

Hi @Bill Sheboy 

Can we set up start date for fix versions in Jira cloud by using Automations??

 

Thanks in Advance.

Raju

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.
May 6, 2021

Hi @Raju Mandapaka 

Yes, and I believe that you would need to do so using a web request action to the REST API edit those fields.

It is not yet possible to set the Start Date directly during the Create Version action.  Here is the suggestion to add that feature: https://codebarrel.atlassian.net/browse/AUT-2027

Best regards,

Bill

Don Doblados May 20, 2021

First off, I wanted to say this is incredibly helpful. Thank you for marking this as a solution.

I have a similar situation as @Danielle Bonneau

Our version naming is a little different. We use don't us a 1.1.0 type of naming. We just use 1, 2, 3...100, etc.

I wanted to know how I can use @Bill Sheboy solution but with numbers without decimals?

For reference, this is Bill's solution.

{{version.name.substringBeforeLast(".")}}.{{#=}}
{{version.name.substringAfterLast(".")}}+1{{/}}
Like Kalos Bonasia likes this
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.
May 20, 2021

Hi @Don Doblados 

This technique is to use the text smart value and math smart value functions to split/parse the just released version to build the new one.  Note for complicated names you may need to use a regular expression with match() and/or replace() functions.

Please take a look at the format of your current version naming to see what is consistent versus variable text, and you should be able to determine what to replace the "." with to make it work. 

If you get stuck, please post your version naming format and what you have tried so far and the community can provide ideas.  Thanks!

Best regards,

Bill

Like Kalos Bonasia likes this
0 votes
prakash December 12, 2022

Hi @Danielle Bonneau 

 

Please share your configuration iam also looking into the version increment.

Now i have jira version "release v3.1.0 " is there, once i released this version automatically creating next version like "release v3.2.0"

 

please share your configuration.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events