Automation Rule || to release version

Oscar Nunez May 20, 2024

I have several version created in Jira, most of them have all the issues in the version in Done status. I would like to release all the version with all issues in status done.

I tried some recommendation, but nothing is working.

 

Screenshot 2024-05-20 181248.png

3 answers

1 accepted

0 votes
Answer accepted
Oscar Nunez May 21, 2024

@Kalyan Sattaluri  you are amazing, thank you so much for your time and super here.

 

here the images:

 

Screenshot 2024-05-21 115210.pngScreenshot 2024-05-21 115154.png

Kalyan Sattaluri
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 21, 2024

Hello @Oscar Nunez 

You have accepted your own post as solution.

Please accept the post I have shared the details in so its easier for folks to understand the steps/solution. Thanks!

1 vote
Kalyan Sattaluri
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, 2024

Hello @Oscar Nunez 

Your lookupIssues JQL is hard to read but it should be:

fixVersion in {{issue.fixVersions}} and status != Done

Next, because you can have multiple fix Versions to a story, after your If condition, you need to do "Advanced Branching" on {{issue.fixVersions.name}} and release version.

Kalyan Sattaluri
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, 2024

Please see below for reference

image.png

Like Luanna Gobbato likes this
Kalyan Sattaluri
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, 2024

BTW, Do you truly want this type of rule?

Typically FixVersions are associated with release Dates.

So if a release date is here ( or nearing), and all issues are done,  *then* you release the version... At least thats how its used.

Implementing above step is different than what you have asked.

So please consider why / how you are using the fix Versions in your firm.

Hope it helps, Thanks!

Oscar Nunez May 21, 2024

@Kalyan Sattaluri  thank you for your answer.

can you please share how do you recommend the automation based on the dates.

 

So if a release date is here ( or nearing), and all issues are done,  *then* you release the version... At least thats how its used.

Kalyan Sattaluri
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 21, 2024

Hello @Oscar Nunez 

If you want to do the check for release date when an issue is transitioned (like you have it in your post), then, inside your advanced branch, you can do a "If check" on the release date, and check if release date is within a certain range.. if so, release the version.

In my below example, I am checking if release date is within 5 days (bolded part)..

Your rule will look like below

  • Trigger = Issue Transitioned
  • If Condition, Field Check -> Fix Versions is NOT empty
  • Action -> LookupIssues -> JQL =  fixVersion IN ({{issue.fixversions}} )and status != Done
  • If Condition ->smart value check -> {{lookupIssues.size}} equals 0
  • Advanced Branch -> Smart value = {{issue.fixversions}}, Variable = varFixVersion
  • If Condition ->Smart value = 
    • {{#if(and(now.diff(varFixVersion.releaseDate).days.gt(-5),now.diff(varFixVersion.releaseDate).days.lt(3)))}}true{{/}}
    • CONTAINS
    • true
  • Action - release version

Screenshot showing only the branch logic cause other steps are as above post..

 

image.png

Oscar Nunez May 21, 2024

@Kalyan Sattaluri thank you for all the support, 

I followed your instructions and it is close, however it gets me this error. Screenshot 2024-05-21 102000.pngScreenshot 2024-05-21 102017.pngScreenshot 2024-05-21 101944.png

 

Screenshot 2024-05-21 102145.png

Kalyan Sattaluri
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 21, 2024

Hello @Oscar Nunez 

I cant see details of your Advanced Branch step where you are providing smart value... but make sure it is like my screenshot. And, please share that screen shot so we can confirm.

Also, In the last step, when finally releasing the version, you need to use {{varFixVersion.name}} smart value. right now you are using just {{varFixVersion}}

Oscar Nunez May 21, 2024

@Kalyan Sattaluri thank you so much, you are amazing, I really appreciate your time and support here.

 

here the  images.

 

Screenshot 2024-05-21 115210.pngScreenshot 2024-05-21 115154.png

Kalyan Sattaluri
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 21, 2024

Hello @Oscar Nunez 

screenshots look good, are you still getting error?

Oscar Nunez May 21, 2024

@Kalyan Sattaluri not errors now.

however still it is not working i am testing with a version that only have 1 issue, and i move to done. and still do not "release" the version.

Screenshot 2024-05-21 125047.png

Kalyan Sattaluri
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 21, 2024

Is the Version's release date in the next 5 days?

Thats what we are testing in the If condition inside the branch.. The below statement:

  • {{#if(and(now.diff(varFixVersion.releaseDate).days.gt(-5),now.diff(varFixVersion.releaseDate).days.lt(3)))}}true{{/}}

What we are checking is, is the release date 3 days past or 5 days in the future. Only then release the version..

You of course need to tweak these values but thats how the rule works..

That is, as you are getting closer to release date, you dont expect any work and so if all stories are done, you release version..

So please change the version release date to 2 days from now and try to rerun the rule and see if version is released..

Hope it helps.

Oscar Nunez May 21, 2024

Sure, it runs and do not report errors, however when you check the version it is not released, and it only have 1 issue and it is on Done status plus the date is ok.

 

Screenshot 2024-05-21 130143.pngScreenshot 2024-05-21 125047.png

Kalyan Sattaluri
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 21, 2024

You have it as May 2025.

We are still in 2024 :p

Please correct the date and re-run.

if rule seems to be working, please tweak the release dates to be in a threshold you/your team is comfortable actually release the version..

If everything is good, please "accept" the answer so it benefits others in the future..

Thanks!

Oscar Nunez May 21, 2024

 

Thank you for all the support, still it is not working, not sure what is the issue, it runs and provide an status of successful, but never execute the release of the version.

 

Not sure what else to do.

 

Screenshot 2024-05-21 141919.pngScreenshot 2024-05-21 141853.pngScreenshot 2024-05-21 141749.png

Kalyan Sattaluri
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 21, 2024

I just tested the exact set of steps and its working for me.

I am not sure what could be the issue at your end.

Maybe try it cleanly.

Create a new version, set that release date to May 23. 

Assign a story to it and transition the story to Done.

And check the rule released it or not.

As mentioned, I have exact same steps on my side and it released the version correctly.

0 votes
Oscar Nunez May 21, 2024

Sure, I set up to May 23rd and there is only 1 issue and in status done, it runs the automation without errors, but do not release the version.

 

 

Screenshot 2024-05-21 130143.pngScreenshot 2024-05-21 125047.png

Suggest an answer

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

Atlassian Community Events