Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply index of an advanced branch as a label to each created issue?

George Tsemberlis July 25, 2023

Hi there

I have several automation rules that used advanced branching to create multiple issues based on unique values (labels on a triggering issue)

branch looks like:

Smart Value
{{#issue.Labels}}{{.}}, {{/}}

Variable Name
UniqueIssue

for each issue that I create (so each UniqueIssue) I'd like to be able to take the position of the label being iterated on (the respective Label) and add it as a label to the newly issue giving me labels of 0 1 2 etc on each respective issue. I've been unable to find a way to get just one index label on each issue instead of all 3 of them (ie separate labels of 0 1 and 2). Any suggestions?

ideal output from the would be three issues

UniqueIssue1 with a label of 0
UniqueIssue2 with a label of 1
UniqueIssue3 with a label of 2

 

Tried using something like this in advanced edit but it gives me 3 labels per issue 

 

{
"update": {
"labels": [{{#issue.Labels}}{"add": "{{index}}"},{{/}}
}
}

Even just getting the "0" label on the first issue created through the loop would actually be the best case scenario.

1 answer

0 votes
DavidBernardoSI1996
Contributor
November 7, 2023

Also have the same question, does anyone know how to do it?

Suggest an answer

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

Atlassian Community Events