Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Global automation: Two "For each" in the same automation with the trigger being "Version released"

Cláudia Silva May 17, 2024

Goal: In a x,y and z project, when a version is released, I want it to go to issues and for each issue present in the issues links -> in the "is validated by" type, I want these linked issues to be cloned.

However, there are several problems in the various tests I did. Firstly, I realized that if the trigger is "version released", then the only options I have are to put the for:JQL condition or for: Issues fixed in version, the issue is that after entering In the issues associated with the version, I cannot create a new for to run through each issue link and clone this one..
Is there any way to get around this situation?

A note: linked issues are from a different project than issues from the released version.
Thank you very much!

 

1.The first screen shot would be the ideal flow, in which I could go to related issues and clone them:

1st attempt.png

2. The second screen shot is to start with for permitted -> for: Issues fixed in version, however I can't put another for...2nd attempt.png

2 answers

1 vote
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2024

Hi @Cláudia Silva 

You can use a smart value condition with:

{{version.project.key}}

exactly matches regular expression

PRONE|PRTWO|PRTHREE

For the for loop you can use branch  / related issues => JQL

For the JQL you can use:

fixVersion = {{version}} and fixversion IN releasedVersions()

This should tackle the problems you described.

Good luck,

Rudy

Cláudia Silva May 17, 2024

First of all, thank you for the brief response @Rudy Holtkamp !

Is it necessary to use ScriptRunner for JQL? This is because I don't have this plugin and when I put this expression, I can't validate the query... Since I created the version variable previously..

But there is a problem here, it is that the linked issues do not have an associated fixVersion and cannot have one because they are like general issues that can be associated with many versions.. that is why I needed to clone these issues and then associate the version.

 

Thank you!!

 

JQL.png

0 votes
Rik de Valk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2024

Hi @Cláudia Silva , 

It is not possible to create a nested loop unfortunately. So you will need to find a workaround for this. 

For example, you work with 2 rules. 

  1. Rule one triggers on Version Released and adds a label 'released' to each issue in the release
  2. Rule two triggers on a Field Change (Label) and has a condition that Labels contains 'released' and
    1. Finds the 'validated by' issue and clones it
    2. Removes the Label 'released' (to prevent this rule to fire a next time a label is changed)

Hope that helps. 

Have a nice day! Rik 

Cláudia Silva May 17, 2024

First of all, thank you very much for the brief response @Rik de Valk !

It really is an alternative, I will have to create two issues and add a specific field for the "released" label situation, but it works for clone issues. Thank you very much!

Like Rik de Valk likes this

Suggest an answer

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

Atlassian Community Events