Automatically Labeling Linked Issues Across Projects
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
The objective is to automatically add a specific label to the "Labels" field in an issue within one project whenever an issue from another project is linked to it. This ensures that relevant labels are added to the destination project, maintaining consistency and improving project management.
For Eg.:
The objective is to automatically add a specific label to the "Labels" field in an issue within the IT project whenever an issue from the TSM1 project is linked to it. Specifically, when an issue from the TSM1 project is linked to an issue in the IT project, the label "TSM1" should be added to the IT issue. This automation helps in maintaining consistency across projects by ensuring that the IT project issues are correctly labeled whenever they are associated with issues from the TSM1 project.
Environment
Jira Service Management Cloud
Diagnosis
The need for this automation arose to ensure consistent labeling of issues across projects when they are linked. Without automation, manually adding labels can lead to errors or inconsistencies, especially in large projects with frequent cross-project issue linking.
The main requirements for the automation were:
- Trigger: The rule should trigger whenever an issue from the TSM1 project is linked to an issue in the IT project.
- Condition: The automation should only proceed if the linked issue belongs to the IT project.
- Action: The label "TSM1" should be automatically added to the IT issue.
Solution
To address this need, a Jira automation rule was configured with the following components:
1. Trigger: Issue Linked
- The automation rule is triggered whenever an issue is linked to another issue. This ensures that the automation activates precisely when the desired action (linking of issues) occurs.
2. Branch: For Linked Issues
- The rule then branches to handle the linked issue separately. This is critical to apply the conditions and actions specifically to the linked IT issue.
3. Condition: Project Key Equals IT
- A condition is set to verify that the linked issue belongs to the IT project. The rule checks if the project key of the destination issue equals "IT".
- First Value:
{{destinationIssue.fields.project.key}}
- Operator: Equals
- Second Value:
IT
4. Action: Edit Issue (Add Label)
- If the condition is met, the automation then proceeds to add the label "TSM1" to the IT issue.
- Field to Edit: Labels
- Value:
TSM1
This setup ensures that whenever a TSM1 issue is linked to an IT issue, the IT issue automatically gets labeled with "TSM1", helping to maintain consistent and accurate labeling across linked issues.