Forums

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

Help with automatically linking two jira tickets with matching labels

Mat Levell September 23, 2024

Hey all, Ive been looking on the forums but haven't been able to get exactly what I need.
Im trying to link two issues (different project) of the contain the same label value. Im using Jira Automation and I was able to get my logic to run but its not finding  the matched issue and in turn not linking.Screenshot 2024-09-23 at 2.00.30 PM.pngScreenshot 2024-09-23 at 2.06.50 PM.png

2 answers

2 accepted

1 vote
Answer accepted
said kouzibry
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.
September 23, 2024

Hi,

  • What does the smart value {{triggerIssue.customfield_10301}} return ?
    • Use a "Log action" with that smart value and see what it returns, then try a normal JQL search using the value returned, this might give you a better idea of what is happening.Something tells me the field "original vehicle id" is a text field, in which case you should use the operator ~ instead of =
  • The "For : Current issue" component looks off to me, I would use "For : JQL" instead

Here is an example of what I have in mind based on what I unserstood from your description

 

chrome_Bhl1LDb9jT.png

 

I hope this helps, let me know what you find out.

0 votes
Answer accepted
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.
September 23, 2024

Hi @Mat Levell 

First, I notice what appears to be a typo in the JQL for your Lookup Issues action: there is a space between the period and the custom field id.

 

Next, you note the issues are in different projects.  What is the scope of your rule: single-project, multiple-project, or global?

A single-project scope rule can create (or clone) issues in other projects, but it cannot access them otherwise.  For the lookup to access issues in another project, and then link them, the rule must be multiple-project or global in scope.

Your Jira Site Admin will need to change the rule scope as it is changed in the global rule configuration area of Jira.

 

Kind regards,
Bill

Mat Levell September 23, 2024

Thanks @Bill Sheboy the typo fixed the finding problem but now its not linking to each other. I suspect im doing something wrong with the branch and link.
Screenshot 2024-09-23 at 2.45.09 PM.png
Screenshot 2024-09-23 at 2.47.58 PM.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.
September 23, 2024

If you want to link those issues to the trigger issue, use a branch on JQL rather than the Lookup Issues action.

Mat Levell September 23, 2024

Thanks @Bill Sheboy I got it working but if I use more than 1 label on the source issue it doesn't work. I source issue might have many labels that will link to a many issues in the other project.Screenshot 2024-09-23 at 3.12.25 PM.pngScreenshot 2024-09-23 at 3.09.59 PM.pngScreenshot 2024-09-23 at 3.09.35 PM.png

said kouzibry
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.
September 23, 2024

Change the JQL to "original vehicle id" in ({{triggerIssue.customfield_10301}}) with no quotes around the smart value.

Mat Levell September 23, 2024

Hi @said kouzibry I tried changing it to "In" and removing the quotes but since im using a label field I dont think its supported. (last resort I can change it to list field)
Screenshot 2024-09-23 at 5.50.02 PM.png

said kouzibry
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.
September 24, 2024

You need parenthesis around the smart value so that when it's interpreted, it would give something like "original vehicle id" in (FME100005)

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.
September 24, 2024

You are missing the outer parentheses that @said kouzibry suggested.

What is the type of this custom field?  That may impact the syntax used for the JQL.

Next, when there are multiple values in the trigger issue, are you trying to match on any values provided, on all values, or both possible cases?

Like said kouzibry likes this
Mat Levell September 24, 2024

yep the parentheses were the problem, It was two custom field (label). If the label/s matched from the CIT issue, it would automatically link to 1 or many VCB issues (there is one matching value in the VCB project). You've both been extremely helpful, I would have been lost without you!!!Screenshot 2024-09-24 at 8.34.40 AM.png

Like said kouzibry likes this

Suggest an answer

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

Atlassian Community Events