Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Problem
Sometimes, a task or project spans across multiple teams or business units, making it challenging to capture all the relevant information in a single Jira issue. When details are added to a ticket in one team's project, they don't automatically transfer to another team's project, leading to the loss of important updates.
ResolutionSolution
To address this issue, you can use a listener script from Power Scripts. This script adds new comments from one team's project to the corresponding issue in another project.
Step 1: Create the script
Create a script, similar to the one below to be called by the listener
Code Block string [] links = linkedIssues(key, "Cloners"); if(size(links) > 0) { JComment lastComment = getLastComment(links[0]); addComment(clone, lastComment.author, lastComment.text, lastComment.securityLevel); }
Info |
---|
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. The link type names can be found on the Issue Linking page in the Jira admin. In the example of 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." |
Info |
---|
The script assumes only 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
Go to Power Apps Config > Power Scripts > Listeners.
Click the Add listener button.
Select the script created above for the listener script.
Leave the Asynchronous option unchecked.
Leave the user input blank.
Select Issue Commented for the event type.
Optionally, add a project and issue type filter to limit the listener to specific project/issue types.
Click Add to save the listener.
Info |
---|
The script attempts to add the comment to the linked issue using the same user profile as the user who created the original comment. If that user lacks permissions to edit issues in the linked project, another user profile can be used as the author for the comment. Modify line 5 of the script accordingly. |
Table of Contents
Table of Contents |
---|