How can I trigger an "issue linked" automation only if there are no other issues linked?
Asked by Alexandra Guna:

Hi guys,

Help please with some pointers on how to get an automation to not run more than once per ticket?

Our particular case: when, from the Service Desk ticket we create the very first Jira issue by using "create linked issue" button, an automation performing some actions has to run - which it does, all good there.

![Screenshot 2024-05-22 at 14.42.48.png](/t5/image/serverpage/image-id/325297i68AE8B57FED73868/image-size/large?v=v2&px=999 "Screenshot 2024-05-22 at 14.42.48.png")

But we only need it to run once per Service Desk ticket.

This means that if we create another Jira issue by pressing "create linked issue", from the same Service Desk ticket, nothing further should happen.

I tried using IF rules with these components, with and without branches, but I can get the automation to stop working.

![Screenshot 2024-05-22 at 14.50.52.png](/t5/image/serverpage/image-id/325298i17D0CB16E745E3C7/image-dimensions/255x474?v=v2 "Screenshot 2024-05-22 at 14.50.52.png")

What am I missing?

Thank you!


Answers:
author: Kalyan Sattaluri
body: Hello [@Alexandra Guna](/t5/user/viewprofilepage/user-id/1452406)

Probably many ways to do this but one way is:

Use the if -\> "smart values condition" and check if:

**{{#=}}{{issuelinks.inwardIssue.size}} + {{issuelinks.outwardIssue.size}}{{/}}**

**EQUALS**

**0**

If so, you continue your steps, else it will exit the If condition.

Please see screenshot for example. Its DC screen but cloud should be same.

Hope it helps. Thanks!

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/325332iBD94DE49844D60AE/image-size/large?v=v2&px=999 "image.png")

comments: author: Alexandra Guna
body: Hi [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306) ,

I tried your solution, but for the Service Desk ticket I can't even manage to get a comment published - so the formula doesn't work.

I'm starting to think that it doesn't work perhaps because I'm trying to make changes in both a Jira project and in a Service Management one via one single rule?

Here's the configuration and the logs, perhaps you can share some more insights? ![Screenshot 2024-05-23 at 11.05.51.png](https://community.atlassian.com/t5/image/serverpage/image-id/325542i2237F8AD7B469381/image-size/large?v=v2&px=999 "Screenshot 2024-05-23 at 11.05.51.png")![Screenshot 2024-05-23 at 11.05.39.png](https://community.atlassian.com/t5/image/serverpage/image-id/325541i1072ACF37E3C7D50/image-size/large?v=v2&px=999 "Screenshot 2024-05-23 at 11.05.39.png")


author: Kalyan Sattaluri
body: Hello [@Alexandra Guna](/t5/user/viewprofilepage/user-id/1452406)

The If condition should be right after the trigger, not inside the branch.

Also, I am not sure why you need a branch.

Can you clarify what is your actual requirement? You mentioned..

"from the Service Desk ticket we create the very first Jira issue by using "create linked issue" button, an automation performing some actions has to run - which it does, all good there. But we only need it to run once per Service Desk ticket."

Are you sharing the screenshot of above ask?


Tags: cloud

jira-service-management

jira-service-management-cloud