Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write automation for duplicated tickets?

Bill Thang
Contributor
April 12, 2023

Hello Community,

I currently need to make an automation for when we close a duplicated ticket about the same issue.

I am new to automation and need your help.

Here is the use case:

Automatic transitions and notifications to requester when there are multiple tickets for the same issue.

  • Issue link type: AST source ticket 1 “is duplicated by” similar ticket number 2

    • Ticket number 2 “duplicates” ticket number 1
  • Duplicated ticket status of ticket number 2 will be transitioned to “Not Doing”. In the comment section of ticket 2, add comment “Hello @Requester, we received another ticket about the same issue mentioned here. Please refer to {ticket 1} for further updates on this issue. Thank you!”

  • In ticket number 2, add the label "Duplicated"
  • At the same time, in ticket 1, the requester of ticket 2 is put in as another Request Participant

Thank you for your help!

Bill.

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
April 14, 2023

Hello @Bill Thang 

Which part(s) of the scenario are you trying to automate? Are you trying to automate all of it?

What is the trigger and what is the action you want to happen? Explain with When/Then statements; i.e.

When: a link is created between two tickets with the "duplicates" link

Then: the "duplicates" ticket should be transitioned to "Not Doing"

And: the "duplicates" ticket gets a comment added automatically with this content...

And: the "duplicates" ticket gets a Label added with the value "Duplicated"

And: the "is duplicated by" ticket is updated so that the Reporter of the "duplicates" ticket is added as a Request Participant.

 

There is an Automation Rule Trigger for  "Issue Linked". With that trigger you have the ability to reference both issues that have been linked together. The trigger part is understanding how to reference them.

From the Trigger itself:

"Rule executes when an issue is linked to another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B. To access ISSUE-A, use {{destinationIssue}}, and to access the link type, use {{linkType}} (e.g. {{linkType}}"

You have to understand how it determines which issue is {{issue}} and which issue is {{destinationIssue}}.

It used the Blocks link type as an example. The source issue is the one that shows it has the Outward Description relationship to the other issue. A Jira Admin can confirm the Outward and Inward Descriptions for link types from administrative settings screens.

Screen Shot 2023-04-14 at 5.43.23 PM.png

 

Here's an example:

Screen Shot 2023-04-14 at 5.44.21 PM.png

In your case you want to take most of your actions on the Destination Issue (the duplicate issue), but it is the Source Issue (the duplicated issue) that will be recognized as the trigger issue. So you'll have to do a bit of work to get to the Destination Issue.

So, your rule structure would be something like this:

TRIGGER: Issue Linked

(This part add the Requester of the duplicate issue to the Request Participants of the duplicated issue.)
ACTION: Edit Issue
Field to set: Request Participants
Click the ... next to the field and select Copy
Click on the text displayed in the field to pop up another dialog
Issue to copy value from: Destination Issue
Field to copy value from: Reporter

(This part makes changes to the duplicate issue.)
FOR BRANCH: Related issue, JQL
Jql: issue = {{destinationIssue.key}}
ACTION: Transition Issue
Destination status: Not Doing
Select additional field to set: Labels
Add Label: Duplicates
ACTION: Add Comment
(Fill in the content you want in the comment.
Use smart value {{issue.key}} to include the key of the issue this one has duplicated.
This post
https://community.atlassian.com/t5/Jira-Service-Management/Project-Automation-How-do-I-tag-the-Reporter-of-an-Issue-without/qaq-p/1244867
shows how to mention the Reporter in a Comment in Automation.)

Trudy Claspill
Community Champion
April 19, 2023

Hello @Bill Thang 

Did the answer I provided help you resolve your issue? If so, please consider marking the Answer as Accepted, to help other users find posts with validated answers/solutions.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events