Forums

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

JQL and Linking tasks to existing work item in another project

Piotr Matera
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2025

Hello all,

In short description: I tried to make a automation triggered manualy that will link task to existing taks in another project if data in one filed is the same, if not it will create new task in second project.

In longer version:
I have to projects A and B, i've created automation that scope is "multiple projects" and both A and B are selected.
Next i created automation like this (which right now is work in progress):

autom.jpg

I need to check if all 4 field are not empty if one of them is empty i need to add comment to task that automation is triggered on - this works fine. It logs and comment.
If all fields have data in them i need to check if "Tracking" field from task that is triggering is somewhere in second project. Now is hardcoded number, that is in task in second project to be sure that proper value is used.
I check if JQL in if block is valid and in search it returns task that i want to link work item to. But never this if statement is true, and never gets to log block.

In audit log this if block returns that it did not match condition
autom-1.jpg
And to be sure if this JQL is valid i use search and proper issue from proper project is found
autom-2.jpg

What i want to achive is to Link PUR-650 inside PRZES-35 as Link work item with "includes".

As seen rest of flow is working good, so if it cannot find any task in second project with proper tracking number it creates it - it logs and create just fine.

Did i overengineer this flow? Or there is something that i dont know? Or what i want to achive is imposible?

1 answer

1 accepted

3 votes
Answer accepted
Tomislav Tobijas
Community Champion
June 30, 2025

Hi @Piotr Matera ,

This part:

If all fields have data in them i need to check if "Tracking" field from task that is triggering is somewhere in second project. Now is hardcoded number, that is in task in second project to be sure that proper value is used.
I check if JQL in if block is valid and in search it returns task that i want to link work item to. But never this if statement is true, and never gets to log block.

2025-06-30_13-23-57.png

Actually looks if trigger item is within specified JQL. As your trigger item is in PUR project and this JQL says project = PRZESYLKI, it will always return false.

What you can use instead is Lookup issues action, which would return the list of items from this second project (if they exist), or maybe even just JQL branch (probably an easier version).

2025-06-30_13-28-59.png

You'd need to play with this a bit more but that's probably the direction I would use when constructing something like this.

There might be ways to make this automation 'prettier', but this should work as well.

Cheers,
Tobi

Piotr Matera
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2025

 JQL branch was answer to my problem. 
Thank you for help.

Like Tomislav Tobijas likes this

Suggest an answer

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

Atlassian Community Events