Forums

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

Jira Automation triggers too many e-mails based on a "label" rule

Deleted user October 30, 2020

Hallo there,

 

i have got a question related to the jira automation. I would like to trigger an e-mail to stakeholders when a certain label "X" has been set. My issue is that this e-mail gets triggered multiple times, even if another label is added such as "Y". Every time there is an interaction, whether its deleting or adding a new label it triggers an e-mail, because "X" is still one of the labels. I would like the e-mail to go out only once, when the label "X" is set and regardless of whatever labels are still added or deleted afterwards. Do you know what I have to do in order to make that happen ?

 

It almost feels like the technical process between setting a label is the following:

You got three labels already set and want to set a fourth one. When you add the forth one and click "ok" it sets all 4 labels again instead of only adding the fourth one.

 

Cheers,

Patrick

2 answers

1 accepted

1 vote
Answer accepted
Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2020

Hi @[deleted] 

You can add new action "Set entity property" -> entity type = issue -> property key "label-email-sent" -> property value = true.

And in the beginning of your rule, add advanced condition -> first value = {{issue.properties.label-email-sent}} -> does not equal-> true

So at first run, the property is false, so the email will be sent, and after the email sent, the issue property is set to true.
Next time the automation triggers again, it will check the property first, this time the value is true, so the rest of the automation will not be execute, and the email will not be sent again.

Deleted user October 30, 2020

Hi Nir,

what a complex but smart solution haha. Thanks a lot. It does seem to work. Moving forward I will see whether I will introduce some new extra fields at some point, but for the moment being it fits its purpose.

Cheers,

Patrick

0 votes
Eduardo Santos
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.
October 30, 2020

Hi @[deleted]

That's exactly what happens, when you update the label field, it adds the labels again. Maybe the labels field is not the best option as it can be misspelled or if the label is removed from all tickets, it will not exist anymore as labels only exist on issues.
I would consider using another field or even create a new custom field for that purpose.

Suggest an answer

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

Atlassian Community Events