JIRA Automation: Trying to create rule based on the issue types linked to trigger issue
Asked by Riccardo Gentile:

Hi all,  
I am struggling to create a JIRA automation rule (for a single project) that goes as follows:

1. When an issue transitions from status A to status B
2. AND if the issue of a specific issue type
3. AND EITHER
   1. at least one linked issue is of a specific issue type,  
      THEN comment on triggered issue
   2. OR at least one linked issue is of a specific linked issue type,  
      THEN comment on triggered issue.

(See screenshot provided)  
Unfortunately, when implementing the rule and triggering the event, no comments are created. It doesn't seem to work nor are the audit logs clear on showing what the issue is.  

I've tried other options but I am not sure where I am going wrong as I am trying to identify if any linked issues are of a specific issue type and then do a certain action on the triggered issue... but I need some help on this one.![24-07-29_19h43m45s.png](/t5/image/serverpage/image-id/338631i33A52A0F40F14318/image-size/large?v=v2&px=999 "24-07-29_19h43m45s.png")


Answers:
author: Trudy Claspill
body: Hello [@Riccardo Gentile](/t5/user/viewprofilepage/user-id/2577620)

Do you want the same comment created if either of the conditions is matched? Or do you want different comments?

Do you want it to make both comments if both conditions are matched?

Can you show us the details in the IF conditions you created?

comments: author: Riccardo Gentile
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/5309476)  
Answer to your questions:  
I am only using the "add comment to issue" command to test if the automation rule works.  
In the screenshot, I am creating different comments depending on which way the logic is directed by the automation process.  
The main issue is that neither of the comments are being created (i.e. the automation doesn't get passed the IF conditions.  
I will add a screenshot of each IF condition below (see added screenshots)![24-07-29_22h25m35s.png](https://community.atlassian.com/t5/image/serverpage/image-id/338670i0E1C8A8C75FF8112/image-size/large?v=v2&px=999 "24-07-29_22h25m35s.png")![24-07-29_22h26m49s.png](https://community.atlassian.com/t5/image/serverpage/image-id/338669i7A95A06E3A94BC0A/image-size/large?v=v2&px=999 "24-07-29_22h26m49s.png")  

<br />

<br />


author: Trudy Claspill
body: Hello [@Riccardo Gentile](/t5/user/viewprofilepage/user-id/2577620)

Your use of a smart value here is incorrect.

![Screenshot 2024-07-29 at 3.43.34?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/338697i64B6120A62D13ACD/image-size/large?v=v2&px=999 "Screenshot 2024-07-29 at 3.43.34?PM.png")

In the context of your rule as it currently is constructed **{{issue.** here refers to the issue that triggered the rule, not the linked issues.

In this case, the smart value you have used actually has no value.

![Screenshot 2024-07-29 at 3.46.43?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/338698i78CE6A6E8861AFDF/image-size/large?v=v2&px=999 "Screenshot 2024-07-29 at 3.46.43?PM.png")

**{{lookupIssues}}**has a value only when a Lookup Issues action has been used, and you have not used that action in your rule.

In the context of your rule and the condition you are trying to use your JQL should be simply:

issueType="Change Request"


author: Riccardo Gentile
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)  

Thank you kindly for your assistance and your suggestion.  

Unfortunately, it did not work.  
I changed both parts to match the JQL you recommended (see screenshot) to see if I would get at least one of the IF conditions to react but the audit log shows no responses to the change. (see screenshots)

![24-07-30_08h58m19s.png](https://community.atlassian.com/t5/image/serverpage/image-id/338746i955219F210D933AB/image-size/large?v=v2&px=999 "24-07-30_08h58m19s.png")![24-07-30_08h59m36s.png](https://community.atlassian.com/t5/image/serverpage/image-id/338747i53404B58A76CBC69/image-size/large?v=v2&px=999 "24-07-30_08h59m36s.png")  

<br />


author: Riccardo Gentile
body: **Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)** I am such a fool!  

Your recommendation worked.  
The reason it didn't seem to work initially was because I forgot to set the scope to Global (instead of just to one project) since the linked issue is from a different project.  
![24-07-30_09h43m39s.png](https://community.atlassian.com/t5/image/serverpage/image-id/338761iF34D7602E427E79E/image-size/large?v=v2&px=999 "24-07-30_09h43m39s.png")

So including setting the correct scope and your recommendation, it solves my issue.  

thank you kindly


author: Trudy Claspill
body: You're welcome!


author: Nicolas Grossi
body: [@Riccardo Gentile](/t5/user/viewprofilepage/user-id/2577620) You might take a look at this thread for the first part: <https://community.atlassian.com/t5/Jira-questions/Is-it-possible-to-use-automation-for-a-certain-issue-type-being/qaq-p/1957825>

Nicolas

comments: author: Riccardo Gentile
body: Hi [@Nicolas Grossi](/t5/user/viewprofilepage/user-id/676185)   
Thank you for the response and reference.  

Unfortunately, it doesn't quite relate to the issue I am struggling with.  
I am able to detect the issue type of the issue that has triggered the automation rule.  
But my problem is I am trying to detect if there is a specific linked issue to the original issue that triggers the automation rule.


Tags: automation

cloud

issue-link

jira-cloud