Linking Issues with Matching Summary
Asked by Renee Troiani:

We receive multiple emails that create tickets with a similar summary. Each summary contains a code such as "MEETING 2023-L567". If I want to lookup existing issues whose summary contains that code and then link the new issue to the existing issue, how would I do that?

To reiterate, I would want the automation to take the summary, compare it to all other issue summaries, find an issue with the same code in the summary, then link those two issues together.

I'm trying to use the "Lookup Issues" action but am not sure what to put for the JQL so that it can dynamically link issues that contain the same summary code.


Answers:
author: Bill Sheboy
body: Hi [@Renee Troiani](/t5/user/viewprofilepage/user-id/5208528) -- Welcome to the Atlassian Community!

First thing, are you using Jira Cloud or Server/Data Center? And if using Server/Data Center, which version of automation do you have: pro or lite? Knowing these things will help the community to offer suggestions that can work with your version of automation rules.

I am going to assume Jira Cloud for now...

Next, there are several parts to solving your problem, including at least:

1. Finding and extracting your "code" from the summary of an issue
2. Finding any matching issues using JQL
3. Linking to the issues in a way which helps solve whatever problem you are trying to solve
4. Deciding when to do this: only at issue create, or also when issues are edited to change the summary

The first one requires you have a consistent format (or formats) for your code, or you will not be able to get the code in a predictable manner. If you can do that, try using the match() or other text functions to get and/or save the code. <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match-->

Once that is solved, you would use a JQL search to find matches, probably with the CONTAINS \~ operator on the summary field. If there are embedded spaces use the *exact phrase* syntax by wrapping the search in escaped quotation marks. <https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/#Advancedsearchingoperatorsreference-CONTAINS-CONTAINS-->

The linking should be easy at this point, as you can branch over the relevant issue keys.

That last item is more difficult if you need to support edit of the summary. This would potentially require removing and then re-adding links to multiple issues. I recommend avoiding this scenario, unless necessary.

Kind regards,  
Bill

comments: author: Renee Troiani
body: Hi Bill,

Thank you so much for the response! I actually figured out a different method to link my issues using a custom field. I couldn't figure out how to remove my question after I figured out a solution.


author: Sofia Shaldikova
body: Hi [@Renee Troiani](/t5/user/viewprofilepage/user-id/5208528) ,

would you mind sharing the solution you find? I'm looking for something similar - to link the issues which has values from the description of the trigger issue in the summary


author: Renee Troiani
body: Hi [@Sofia Shaldikova](/t5/user/viewprofilepage/user-id/5045158)

![Screen Shot 2023-08-17 at 8.23.32 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/275750i2A76693540B0CF2B/image-size/large?v=v2&px=999 "Screen Shot 2023-08-17 at 8.23.32 AM.png")![Screen Shot 2023-08-17 at 8.21.20 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/275751iEE4B4724D55014C0/image-size/large?v=v2&px=999 "Screen Shot 2023-08-17 at 8.21.20 AM.png")

Here is a screenshot of the automation I ended up with. Basically, I used ChatGPT to give me the smart value that will extract the code from the summary and save it to a variable. That variable goes into a custom field and the issues that have matching values for that custom field are linked.


Tags: issue

link

smart-value

summary