Forums

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

Automation for Jira Question: Clone Issue Only One Time When a Specific Label is Added

Jess_Ignasiak December 29, 2022 edited

Apologies if I'm missing something obvious.

Currently, we have a rule set up that when a specific label (let's call it Label B) is present on a ticket in Project A, it creates a clone of the issue in Project C.

Ideally, we would only want this issue to be cloned one time only when Label B is added initially. However, occasionally a new unrelated label will be added to the ticket AFTER Label B is added. So, when a new unrelated label is added, the rule runs again because it sees the Label field has a new value added, sees that the ticket has Label B, and thus creates another clone.

Is there a way to ONLY create a clone one time WHEN Label B is added to the ticket? Not when a value changes in the ticket and Label B is merely present?

 

2022-12-29_15-35-43.png

1 answer

1 vote
Trudy Claspill
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 29, 2022

Hello @Jess_Ignasiak 

Whenever you ask about an Automation Rule, please provide a full copy of the rule. It is hard for us to provide advice on how to change it without having those details.

The likely solution involves change the trigger so that it is triggered when the Labels field changes and a value is added, and then adding a condition to check that the specified value is the one that was added.

Jess_Ignasiak December 29, 2022

Thanks for the response! That was my instinct to use the "Field Value Changed" for labels, but it looks like I can only get it to fire when a label is added or removed, not for a specific label. I'm unsure what you mean by the condition that would be added to check for the specific value.

 

2022-12-29_15-38-13.png

Trudy Claspill
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 29, 2022

When changes are made to an issue the before and after values are recorded for the changed fields.

You can access this information in an Automation Rule and check how the field changed.

In this case you would add another Component for a Condition, after the trigger.

Screen Shot 2022-12-29 at 12.57.36 PM.png

Then select the Advanced Compare option.

Then check if the before value included the label you seek. If it was there before the change then it has not been newly added, so you don't want the rest of the rule to run.

Screen Shot 2022-12-29 at 1.12.02 PM.png

If this condition passes, then you need to check if the label was present after the field was updated. If it wasn't present before, but is after, then it has been newly added.

Screen Shot 2022-12-29 at 1.13.33 PM.png

If the labels was not present before the field was changed, and is present after the field has changed, then it has been newly added and the rest of the rule will proceed running. If either condition is not met, then the rule will exit with no action taken.

Bill Sheboy
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 29, 2022

Hi, Trudy! 

Did you try that one with changelog?  I recall a recent defect that some list/list-like fields were not working consistently for the changelogs in automation rules with {{fromString}} and {{toString}}

Kind regards,
Bill

Trudy Claspill
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 29, 2022

I did try it, but not exhaustively. I tested with adding only up to 2 labels.

I did only a few tests. If the results are inconsistent then I may not have tried enough tests or enough entries.

Like • Bill Sheboy likes this
Bill Sheboy
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 29, 2022

Please disregard, as that open issue appears to be with components and versions: https://jira.atlassian.com/browse/JIRAAUTOSERVER-207

Jess_Ignasiak December 30, 2022

I will give this a try, thank you!

Suggest an answer

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

Atlassian Community Events