Forums

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

Automation label text

Tamir Melamed November 16, 2023

I would like to perform automation every 2 week to increment labels numbers, exmaple:

if label contains "WW" (i.e. full label: "WW47-48/2023") i would like to remove it and create and apply the incremented label "WW49-50/2023".

PS

i managed to do a scheduled automation, just need to figure out the labels

 

2 answers

0 votes
Tamir Melamed November 16, 2023

Comments on this please:

1.png2.png3.png

0 votes
Alexis Robert
Community Champion
November 16, 2023

Hi @Tamir Melamed , 

 

this is a bit more complicated than it looks because you need the Smart Value to identify the week number in the label, and then increase it.

I have not tested this, but you could try and see if this works for example : 

 

"WW" + ({{issue.labels.first.match("WW(\\d+)-\\d+/\\d{4}")[1]}} as number + 1) + "-{{issue.labels.first.match("WW\\d+-(\\d+)/\\d{4}")[1]}}/{{issue.labels.first.match("WW\\d+-\\d+/(\d{4})")[1]}}"

 

You might need to adapt it if that doesn't work exactly as expected.

 

Let me know if this helps,

 

--Alexis

Tamir Melamed November 16, 2023

would it work:


{
"update": {
"labels": [
{
"add": "WW{{now.addWeeks(1).format("WW")}}-{{now.addWeeks(2).format("WW")}}/{{now.format("YYYY")}}"
}
]
}
}

 

?

Suggest an answer

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

Atlassian Community Events