How to compare tickets using a custom text field and link matching tickets

melissa.cheney November 13, 2024

We need to find all tickets (several thousand in the project) that have the same value in a text custom field (an Engagement ID), then link them together. My findings is it is not possible to identify the matching tickets, grouped together, in a filter so an automation is required, thus I added the linking of the tickets to the automation.

I think I am very close, but I am getting an error that one of the fields does not exist or I do not have permission to view. I am the Administrator and can definitely view it. Also, when it references the field in the error, it lists the value in the field not the field name itself. 

Here is my automation: 

When rule is triggered: (selected multiple issue events) Issue Creation or Issue Update

If: Engage ID (field name) is not empty

Branch rule/related issues

Type of related issues: JQL

JQL: project = Test AND {{issue.customfield_10161}} ~ {{issue.customfield_10161}}

Will select "Only issue that have changed since last time this rule executed" after first successful run and linking

Then add value to Audit Log: Tickets from JQL are {{issue.key}}

Then: And Link issues - relates to     Trigger Issue

I am unable to put the screen shot here.

1 answer

1 vote
Marc - Devoteam
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.
November 13, 2024

Hi @melissa.cheney 

I would look at if from another way by using a variable.

See my example:

Screenshot 2024-11-13 at 16.56.45.png

 

 

melissa.cheney November 25, 2024

I partially got it to work, but it is only linking the last tickets, not all tickets.

My correction to the initial rule - 

Type of related issues: JQL

JQL: project = Test AND {{issue.customfield_10161}} ~ {{issue.customfield_10161}}

 

Changed it to -

Type of related issues: JQL

JQL: project = Test AND Engage ID ~ {{issue.customfield_10161}}

This allowed linking of all existing tickets when new ticket created, but then did not link to any new tickets. Only new tickets linked to new tickets.

 

Using the information from Marc, I added a Create Variable - named lookupissue and it equaled {{issue.key}}

When I ran this version, the new ticket "Test 3" linked to all the tickets in the project, including "Original Test" and "Test 2" ticket with the same Engage ID but "Original Test" and "Test 2" did not link, even though both linked to "Test 3"

My trigger is new or updated issues. 

Would changing the trigger to scheduled have all tickets with same Engage Id be linked? 

2024-11-25_17-02-03 Link Automation.png

melissa.cheney November 26, 2024

The "And Link issue to" {{lookupissue}} - the smart value created before the branch - is not linking any tickets..... Changed back to using {{issue.key}} so it at least links some...

Marc - Devoteam
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.
November 27, 2024

Hi @melissa.cheney 

You need to branch on the variable.

To link only the lates tickets or specific tickets, have a specific Link type for this.

So this differentiates the issues that a re relevant.

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