How could I assign a dynamic label based on a custom field value and update date?

OriO December 14, 2022

Dear community,

We have a custom field "Severity" which has 'Emergency', 'Sev.1', 'Sev.2' and 'Sev.3' as options. If the value is "Emergency" We would like to automatically assign the label "Emergency_YY_WXX" to the ticket, where 'YY' and  'XX' must correspond to the year and the week numbers of the date on which the ticket was set as Emergency. 

We're use to work with ScriptRunner, and I've look around a similar case but I did found a clear solution to dynamic labels.

Could you help me on this one?

3 answers

1 accepted

0 votes
Answer accepted
OriO December 26, 2022

Hi @Fabio Racobaldo _Herzum_ , @Marco Brundel 

Thanks for your inputs, unfortunately we do not have automation in our JIRA instance, so I could not use Marco's option.

I'm not familiar with Behaviors, I will take a look and see if I can make a script with that.

Thanks

2 votes
Marco Brundel
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.
December 14, 2022

Hi @OriO ,

Behaviour is a good option. But you can also have a look at Automation for Jira.

When I set 

Emergency_{{now.format("yyyy")}}_{{now.weekOfYear}}

in 'comment on Issue' action I get as a result

Emergency_2022_51

 Screenshot 2022-12-14 at 11.53.45.png

Regards, Marco

Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 14, 2022

correct @Marco Brundel , automation is a good solution ;)

Like Marco Brundel likes this
2 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 14, 2022

Hi @OriO ,

you can implement that requirements through a Behaviour (something like https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-examples/setting-field-defaults

Please let us know if you need support on that.

Fabio

Suggest an answer

Log in or Sign up to answer