Linking issues using summary substring

kcarpenter March 23, 2023

Hi. I have Jira issues that follow a consistent naming convention. For example 'ABC_### - full name of request goes here'

When a new issue is created and the summary/title is updated (have it just set up to be manually ran for right now) , I want to automatically link existing issues that start with the same 7 characters ('ABC_###'). I tried using a substring on {{issue.summary}} but couldn't quite get it to work.

Any help would be greatly appreciated!

JQL substr.PNG

 

1 answer

0 votes
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.
March 23, 2023

Hi @kcarpenter -- Welcome to the Atlassian Community!

For a question like this, please post images of your complete rule and the audit log details showing the rule execution.  Those may provide context for what is happening, enabling the community to give suggestions.  Thanks!

And...if the substring is always 7 characters at the start of the summary, have you tried using the left() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#left-int-length-

Kind regards,
Bill

kcarpenter March 23, 2023

Hi Bill.

Thanks for your reply. The left function is exactly what I was looking for!

My rule runs successfully now. However, it is not linking the other issues in my project that start with the same 7 characters. Is there a change that needs to be made to my if statement?

Updated automation.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.
March 23, 2023

What is the purpose of that condition, as it seems to be testing a value against itself?

And, would you please show the details of your link issue action?  The rule shows "success" but that action does not appear in the log for some reason.

kcarpenter March 24, 2023

That's what I'm struggling with - I don't know how to make it test values against all other issues in my projectLink issue details.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.
March 24, 2023

Perhaps try this to find the issues, and then iterate over them to link to the trigger issue:

  • trigger: manual
  • branch: on JQL of...   
    • project = myProjectName AND summary ~ {{triggerIssue.summary.left(7)}} AND key != {{triggerIssue.key}}
    • action: link to the trigger issue

Please add any additional conditions/tests you need to the JQL to ensure you get the correct issues to link.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events