Forums

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

Link Tickets With The Same Summary

Kiran Venugopal October 2, 2024

Hello,

What rule can I create to link the following tickets or add the duplicate ones to the comment.

Link Ticket.png

1 answer

1 vote
Trudy Claspill
Community Champion
October 2, 2024

Hello @Kiran Venugopal 

Welcome to the Atlassian community.

Have you tried to create the rule? If so, show us what you have so far.

What issue event should trigger the link creation? 

Should all the issues with identical summaries be linked to each other? Or is one of them considered the "primary" to which all the others should be linked?

Kiran Venugopal October 3, 2024

Hi Trudy no I have not yet, yes that's correct, all issues with the same summary should link tickets and if possible add the new ticket as comments to the primary one.

Trudy Claspill
Community Champion
October 3, 2024

What issue event should trigger the link creation? 

It looks like you have an existing set of issues that have the same summary. Are you looking for a rule that you can run now to link those all together?

Are you looking for a rule that will run whenever a new issue is created and look for other issues with the same summary, and link them?

 

and if possible add the new ticket as comments to the primary one.

How do you identify the ticket that is the primary ticket?

Kiran Venugopal October 3, 2024

Hello, I'm looking for a rule that runs every time a ticket is created. The ticket comes in from another Jira instance, so the summary will be the same every time every time. We can ignore the ticket comment as if identifying the primary ticket is difficult as they are all the same

Kiran Venugopal October 3, 2024

Hi Trudy, to add on.

I created the following rule with Jira AI which seem to be working. 

Link Ticket.png

 

Is there a way to edit this ticket, in which new tickets with the same summary that comes will get added to the primary ticket which came in first as a comment?

 

 

Trudy Claspill
Community Champion
October 3, 2024

Add this sequence of steps to your rule:

Screenshot 2024-10-03 at 10.10.27 PM.png

The Lookup Issues action will search for the issues that have the same summary as the trigger issue and order them by their Created date with oldest one listed first. {{lookupIssues}} is set to the list of issues found by the JQL.

The condition checks the size of the list to confirm at least one issue was found. size is an attribute of lists.

You then use the For: Each: Related Issues: JQL to retrieve just that one oldest issue. Since {{lookupIssues}} is a list of issues you can use the first attribute to reference the first item/issue in the list. You can follow that with any attribute/field that is normally accessible for that type of item; i.e. for issues you can access key.

Lastly, within that branch, you use the Comment Issue action to add the comment to that oldest issue that you have retrieved.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2024

Greetings!

For the JQL with the Lookup Issues action, I recommend using the exact phrase syntax for the CONTAINS ~ operator: https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CONTAINS----

project = yourProjectName
AND summary ~ "\"{{issue.summary}}\""
AND key !={{issue.key}}
ORDER BY created ASC

Otherwise the matches will be on the words within the Summary, in any order, and not the exact same Summary value.  Please note well: this could lead to matches where the search text is led or followed by other text.  So matching summaries could be:

  • your search text
  • some leading text your search text
  • your search text some trailing text
  • some leading text your search text some trailing text

Kind regards,
Bill

Like Trudy Claspill likes this
Trudy Claspill
Community Champion
October 4, 2024

Good catch, @Bill Sheboy !

Like Bill Sheboy likes this
Kiran Venugopal October 23, 2024

Hi Both,

Thank you for taking the time to explain the steps to me. Is the following how it is supposed to look? I am fairly new to Jira automation so I am a little confused on the setup.

JIra Rule.png

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2024

The JQL for you branch is missing the quotation marks around the project name.  Please add those and then test your rule.

 

And...with the Issue Created trigger, I recommend adding the Re-fetch Issue action immediately after the trigger.  That can prevent timing problems as that specific trigger can fire so quickly that some data may not be available to the rule yet.  Re-fetch will slow the rule down a bit and reload the data before proceeding.

Kiran Venugopal October 23, 2024

Hi Bill,

Sounds good iv made the changes, can you review the screenshot below if they are looking accurate?

JIra Rule.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2024

What happened when you tried testing the rule?  What did the audit log show?  Successfully using Jira Automation requires learning and experimentation, so please remember to test your rules (and their JQL).

 

If you look closely at that branch JQL, and tested the rule, you will see the ending quotation mark appears to be in the wrong place.

 

Kiran Venugopal October 23, 2024

Hey Bill,

I tested it and the log shows the following error.

JIra Rule.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2024

As that error shows, there is also an error with the JQL for your Lookup Issues action.  Please correct that to remove the stray quotation mark.

Kiran Venugopal October 24, 2024

Hey Bill,

Yes, I fixed the quotation mark issue yesterday, and the audit logs started showing success when the rule ran. However, it is not adding comments from the prior ticket with the same summary to the new ones. Based on your expertise, would you be able to take a look at the rule one more time and see if you can spot any errors/discrepancies?

JIra Rule.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 24, 2024

Please post an image of the audit log details showing the updated rule's execution.  That will indicate what happened when the rule ran.  Thanks!

Kiran Venugopal October 24, 2024

JIra Rule.pngDPTAR-1022 and DPTAR-1021 have the same summary but description from 1021 has not been added to 1022

Trudy Claspill
Community Champion
December 6, 2024

Hello @Kiran Venugopal 

You have a typo in this step:

Screenshot 2024-12-06 at 5.27.23 PM.png

The "i" in lookupissues must be capitalized: lookupIssues

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events