Skip to end of banner
Go to start of banner

Synchronize comments between projects

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Problem

Often a body of work is not able to be captured within a single issue in Jira since it requires multiple teams or business units to accomplish. Information added to a ticket in one teams project does not automatically flow through to the other teams project and important updates can become lost.

Solution

To solve this problem, a listener script from Power Scripts can be used to add new comments from one teams project to the corresponding issue in another project.

Step 1: Create the script

  1. Create a script similar to the one below to be called by the listener

    string [] links = linkedIssues(key, "Cloners");
    
    if(size(links) > 0) {   
        JComment lastComment = getLastComment(links[0]);
        addComment(clone, lastComment.author, lastComment.text, lastComment.securityLevel);
    }

The above script finds the corresponding issue by using links. This script uses the “Cloners” link type specifically but any link type can be used. Please note that the link type name should be used. This name is different the outward and inward link descriptions. For example, with the Cloners link type the outward description is “clones” and the inward is “is cloned by” but the name for the link type is “Cloners”. The link type names can be found on the Issue Linking page in the Jira admin.

The above script assumes that there should only be one link of type “Cloners” for the issue since the issue can only be cloned from a single source. If using a different link type the script will select the first link it finds for the given type.

Step 2: Configure the listener

  1. After selecting a script for the listener, choose the event the listener should respond to. Only issue specific events like Issue Created, Issue Updated, etc. can then be filtered by project and issue type.

  2. After selecting an issue specific event the input form will update with the new controls for filtering:

  3. The project and/or issue type filters can then be applied:

  4. Click the Add button to complete the setup of the listener

Note:

  • Both the project and issue type filters can be set independently, they are not needed together

  • Multiple projects can be added to the project filter

  • Multiple issue types can be added to the issue type filter

Table of Contents

  • No labels