Synchronizing Attachments Between Linked Jira Issues Across Different Projects
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
In certain scenarios, it may be necessary to synchronize attachments between linked issues from different projects within Jira. Although the 'Field value changed' trigger for the Attachment field can be utilized in Jira Software projects, it does not work with Jira Service Management Projects. This article outlines a workaround for syncing attachments between a Jira Software project and a Jira Service Management project, assuming that the issues in both projects are already linked.
Solution
Scenario 1: Copying Attachments from Jira Software to Jira Service Management Projects
To sync attachments when they are added to a Jira Software project and need to be copied to a linked issue in a Jira Service Management project, follow these steps:
1. Create an Automation Rule with the Trigger 'Field value changed' for the Attachment field.
2. Add a "Branch rule" for Linked issues.
3. Add an "Edit issue" action and choose the Attachment field to copy the attachment from the Trigger issue.
By following these steps, attachments added to a Jira Software project will be automatically copied to the linked issues in a Jira Service Management project.
Scenario 2: Copying Attachments from Jira Service Management to Jira Software Projects
Since the 'Field value changed' trigger does not work for attachments in Jira Service Management, an alternative approach is required:
1. Create a New Automation Rule with the Trigger 'Issue commented' as attachments in Jira Service Projects are added as a part of comments.
2. Check for Attachments Using Regular Expression:
- Add an "If" condition with "{{smart values}} condition":
First value: "{{triggerissue.comment.last.body}}" to check the last comment.
Second value: Use a regular expression like "png|jpg" to identify comments that include attachments with the specified file extensions.
This will allow the automation rule to trigger and take actions for the issues in Jira Service Projects where attachments are added.
3. Like the previous rule, add a "Branch rule" for Linked issues.
4. Add an "Edit issue" action to copy attachments.
By implementing this rule, attachments added to comments in Jira Service Management projects will be copied to the linked linked issues in Jira Software projects.
The automation rules outlined above provide a foundational setup for synchronizing attachments between linked issues across different Jira projects. However, users are encouraged to include additional checks or actions to tailor the automation to their specific needs and project requirements. This may include specifying additional file types, implementing conditions for specific issue types, or incorporating other project-specific actions.
By utilizing these automation strategies, we can streamline the process of attachment synchronization, ensuring that relevant files are readily accessible across linked issues in different Jira environments.