Auto release multiple issues in a project

Kevin McGillicuddy May 25, 2021

I have an automation rule to create a release version and then release it and mark the issues/tickets and done and resolved. What happens is if multiple issues are in the release, the first time the rule runs it goes fine but then it runs and fails for all the other issues because the version name already exists

is there a better way to do this?


config.PNGrelease.PNG

2 answers

0 votes
Kevin McGillicuddy May 26, 2021

OK I think I have a fix in place now - will come back to this if this does not work as we hit other workloads but new layout is this:

new.PNG

With the "edit issue field - Fix Version" using the fix version for the next unreleased version


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

Hi @Kevin McGillicuddy 

Although you may be able solve this within the rule, you may want to pause and think about your process. You appear to have only posted part of your rule, and if I am understanding from your rule.  If possible, please post an image of your complete rule.

  1. Some trigger and other steps...
  2. When an issue transitions to deployment status of Successful in Production...
  3. Create a new version (ideally only when it does not yet exist)
  4. Transition the branch issue (trigger issue?) to Resolved
  5. Release the new version
  6. Edit the branch issue (trigger issue?) Fix Version and Resolution

You note this fails for subsequent calls, but I wonder why as...

  • You are including {{now}} in the name, so that should make it unique for each issue triggered...theoretically if they do not occur within the same fractional second.  Unless there is more to your rule which is causing multiple, asynchronous calls to create version close in time.
  • You are including some commit information in the version name, yet that appears to be missing in the log you have shown

Some Options are:

a) confirm if the second attempt to create the version is causing the remainder of the rule to fail.  If not, consider ignoring the error.  (This was recommended in another community post for this use case.)

b) think about when you create versions and decide if they should be done independently of issue handling

c) call the REST API using a webrequest to check if a version already exists.

 

Best regards,

Bill

Kevin McGillicuddy May 25, 2021

Hey @Bill Sheboy  this is the full rule - it has worked for a while now, just again its more an annoyance that when I look at run audit logs it shows some failed with errors. 

it 100% fails for issues 2 through 4 because the timestamp version name is the same - this is because its doing it for each ticket (qty4) the commit short has I was using to try to add more uniqueness until I found the real issue

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 25, 2021

Thanks!  Looking at your image, there appears to be a component above "When: Deployment status changed.." which I why I asked if that was the complete rule as no trigger appears to be shown.

Is the rule triggered separately for each issue, 1-4, or one execution trigger gathering and processing 4 issues?

Kevin McGillicuddy May 26, 2021

oh no so when deployment status changed is a trigger - since we have bitbucket, when the issue linked to the branch sees the pipeline deployed to Prod it triggers this rule

I believe its the former.. since each issue is its own Jira ticket with its own bitbucket branch but as I said its strange on first run it gets all 4 issues in the first release, which is reight and then fires empty and so fast it makes these empty duplicate releases which never actually get created (since they would in theory sit in a unreleased state)

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 26, 2021

Thanks for clarifying that!

If your goal is to have the 4 issues (with different branches) in the single Jira version/release, please take a look at those subsequent firings to see if there is information in the trigger message that can be used to ignore the version creation steps in the rule. 

If instead your goal is to have each issue in a separate Jira version/release, you would need to modify the version create in a manner which makes its name unique, as you cannot rely on date/time {{now}} without using the millisecond format.

Otherwise, there may be a defect in here, and I recommend that you submit a support ticket to Atlassian to see what they say about that trigger.  You should be able to do that as site admin for a paid instance here: https://support.atlassian.com/contact/#/

Once you hear back from support, please post what you learn so the entire community can benefit.  Thanks!

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