Automation For Jira - How to write a rule that moves issues to the Epic issue type from a different type

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

When a user tries to bulk move issues from a certain type (Story, Bug, Feature...) to the Epic issue type, the Bulk Update functionality forces the user to give a value to the Epic Name field, as it is a mandatory field for Epics:


The problem is that:

  • the Epic Name field does not exist for other issue types
  • as a result, this field is empty and is forced to be manually set to random value, which will applies to all issues moved during the bulk update
  • it is not possible to populate this field with the content of other fields, when using the Bulk Update feature

The purpose of this article is to describe how to configure a rule using Automation For Jira to workaround the Bulk Update feature limitation.

Environment

  • Jira Server / Data Center 8.0.0 and any higher version
  • Automation for Jira 7.4.0 and any higher version

Solution

Preliminary step

(warning) For the automation rule to work, it is mandatory that both the source issue type and the Epic issue type are associated to the same workflow within the project. If both issue types are using different workflows, the automation rule will fail to execute.

If both issue types are using different workflows, edit the workflow scheme associated to the project both issue types belong to, so that they are both using the same workflow. For more information about how to configure workflow schemes, refer to the documentation Configuring workflow schemes.

Configuration the automation rule

Here is how the rule should be configured:

  • Trigger: Use the "Scheduled" trigger, with the settings below:
    • Fixed rate of every: you can choose 10 days for now, it does not matter as we want the rule to be executed only once
    • When rule executes...: select the option run a JQL search and pass results to subsequent conditions and actions
    • JQL: enter the JQL query of your choice, which allows you to search for all the issues that need to be moves
    • (warning) Untick the option Only include issues that have changed since the last time this rule executed 
  • Add the Action "Edit Issue Fields"
    • Select Issue Type as the field to update
    • Set it to "Epic"
  • Add the Action "Re-fetch issue data"
  • Add the Action "Edit Issue Fields"
    • Select Epic Name as the field to update
    • Inside the "Epic Name" field, enter the following string:
      {{issue.summary}}
      

After you configure the rule:

  • Save the rule
  • Use the button Run Rule to execute it once
  • Check the Audit Logs page of the rule to verify that it was successful
  • Disable the rule, in case you don't need to the rule to be executed again in the future (in case you were only planning to perform the Move operation once)

Here is a screenshot showing what the rule would look like:



Last modified on Aug 20, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.