Automation For Jira - Writing a rule that syncs fields and comments

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Automation for Jira does not come with an action allowing to sync all the data (fields/comments/statuses...) between Jira issues, as per the feature request linked below:

  • JIRAAUTOSERVER-751- Implement a new action meant to sync field updates, transitions, and comments between linked issues

While no automation action allows for synchronizing everything between Jira issues, it is still possible to write automation rules that will help sync some data (but not everything) between issues.

The purpose of this knowledge article is to show how to write automation rules that will automatically:

  • copy specific field values between linked Jira issues, whenever such fields are updated in the linked Jira issue(s)

  • add a comment to a Jira issue, whenever a new comment is added to the linked Jira issue(s)

Solution

The solution consists in writing:

  • 1 automation rule that will copy the value of specific Jira fields (for example, the description and the summary fields) between linked Jira issues

    • Note that you can modify this rule, based on the fields that you need to sync

  • 1 automation rule that will copy comments between linked Jira issues

Automation rule 1

  • Add a Field Value changed trigger

    • Put the list of fields you need to watch (for example:Summary, Description)

    • In the For field, use Edit issues

  • Add an IF/Else block

    • In the IF block

      • Add an "Advanced Compare condition" with the following condition:

        1 {{changelog.summary}} does not equal empty

  • Add a Branch rule / related issues with Linked Issues

  • Add an Edit issue fields action with: "Copy Summary from Trigger Issue"

  • In the ELSE-IF block

    • Add an "Advanced Compare condition" with the following condition:

      1 {{changelog.description}} does not equal empty

  • Add a Branch rule / related issues with Linked Issues

  • Add an Edit issue fields action with:

    1 Copy Description from Trigger Issue

  • Add as many ELSE-IF blocks as fields you need to update

The rule will look like this:

Automation rule reference

Automation rule 2

  • Add an Issue Commented trigger

  • Add a Branch rule / related issues with Linked Issues

  • Add a Comment on issue action

  • In the Comment field, add the expression below:

1 {{triggerIssue.comment.last.body}}

The rule will look like this:

Final rule screenshot

Updated on June 6, 2024

Still need help?

The Atlassian Community is here for you.