Automation | Create an issue only when a specific Label is added to the Jira issue
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
This article helps in creating a Jira issue based on the label field value via automation. A rule example has been detailed below. The conditions in the rule can be customized as per the requirement.
Environment:
Jira cloud
Solution :
Trigger: When a Field value is updated
Fields to monitor when changed: Labels
Change type: Value added
For: Create issue | Edit issue
Condition: Advanced compare condition
First Value: {{fieldChange.fromString}}
Condition: Does not contain
Second Value: test
Condition: Advanced compare condition
First Value: {{fieldChange.toString}}
Condition: contains
Second Value: test
Then : Create issue
The first advanced compare condition ensures that the label being checked is not already a part of the "labels" field and the second advanced compare condition checks that the label being checked is a new label that's added to the label field.
Sharing snippet for reference and automation rule to import: automation-rule-13801634-202308011203.json
Note
There is an alternate approach to setup this use case as shared in the example below:
The limitation observed with this approach is that it creates the issue when another label has been removed from the Labels field even though no changes were made to the label being checked. To overcome ths challenge, the rule suggested at the start of the KB can be utilized.