How to restrict auto creation of duplicate issues when an issue is reopened

Whenever multiple issue creation is configured for the Creation on Transition post function and the same transition occurs after the reopening the issue, the post function is run again resulting in duplicate issues. This article explains how to restrict the creation of duplicate issues when the issue is reopened.

Instructions

  1. Log into Jira as a Jira Administrator and click  > Issues  > Projects.
  2. Navigate to the intended project and click Project Settings > intended workflow.
  3. Click the transition for which Create on Transition is configured. 
    Let's assume a sample post function configured for creation of multiple issues for custom field value selection. Please refer to How to create multiple issues for more information.
    Post Function
  4. Click  to edit the Create Issue post function
      
  5. Select the Conditions & Configuration tab on the left navigation panel.
  6. Enter the below mentioned JQL in JQL query field: 


    The query checks whether the original issue was in closed status or not.

    issue = %original_key% AND Status was in (Closed)

  7. Add the below mentioned condition for the issues to be created only when the condition is met:
      
  8. Update the configuration and the updated post function looks like:
     

  9. Publish the workflow before executing the transition. You see that no duplicate issues are created when the same transition occurs after reopening the issue.

It is recommend to test this scenario in a test environment before implementing the same in the production.