Automation When status changes add comment on linked issue
Asked by Colleen Cosgrove:

I would like to automate adding a comment on a linked issue of a particular type when the issue goes into a given state

I tried the following... not sure how to add fix version in comment but i didn't get the comment anyway - it gets triggered but cannot find the linked ticket - the ticket is linked - see screenshot

![Screenshot 2024-07-22 at 6.40.39?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/337159i79F3B99CC6F980C4/image-size/large?v=v2&px=999 "Screenshot 2024-07-22 at 6.40.39?PM.png")![Screenshot 2024-07-22 at 6.42.40?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/337161iC7D36396D5E329F8/image-size/large?v=v2&px=999 "Screenshot 2024-07-22 at 6.42.40?PM.png")![Screenshot 2024-07-22 at 6.44.19?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/337162i2FC44E5996BB167B/image-size/large?v=v2&px=999 "Screenshot 2024-07-22 at 6.44.19?PM.png")


Answers:
author: Colleen Cosgrove
body: Thanks for the pointers... I have tried both:

A fix for this ticket has been included in the {{triggerIssue}}  
{{#lookupIssues.fixVersion}}  
{{/}}  
release

and A fix for this ticket has been included in the {{triggerIssue.fixVersion}}  
release

but neither worked


author: Trudy Claspill
body: Hello [@Colleen Cosgrove](/t5/user/viewprofilepage/user-id/5549661)

Welcome to the Atlassian community.

Have you tried to create this rule yet? Show us what you have so far, and tell us the part with which you are struggling.

Are the transitioning issue and the linked issue always going to be in the same project, or might they be in different projects?

comments: author: Colleen Cosgrove
body: they are different projects... i have put what i have so far in the original ticket and the audit of what happens


author: Trudy Claspill
body: Thank you for that additional information, [@Colleen Cosgrove](/t5/user/viewprofilepage/user-id/5549661)

To have a rule triggered by an action in one project and from that cause a change to an issue in a different project, your rule will have to be a Multiple Project Scoped rule.

Such rules can be created only by Jira (Application) Administrators. They can't be created by Project Administrators. Are you a Jira Administrator?

A Jira Administrator would need to navigate to the Global Automation page. This is accessed by clicking the gear icon near your avatar in the upper right corner on the application's menu bar. From there one selects System, which displays the System some of the overarching System wide configuration options, including Global Automation.

On that page the Jira Admin would find the rule you have created, open it for editing, and navigate to the Rule Details page.

From there the admin would change the **Scope** of the rule to Multiple Projects, and then select the two projects in the **Projects** list.

![Screenshot 2024-07-22 at 4.28.33?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/337165iF827E0025AEDA156/image-dimensions/340x347?v=v2 "Screenshot 2024-07-22 at 4.28.33?PM.png")

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

After doing that and saving the change, your rule would then be triggered by an Issue Transitioned event occurring in **either** project. If you only want the rule to proceed only if the transition occurs for the issue in the BAS project, you would need to add a condition to check the Project field.

If you want the rule to proceed to update linked issues only from the NAS project, then you would want to add a condition within the branch also to check the Project field of the linked issue.

![Screenshot 2024-07-22 at 4.35.52?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/337167i3B8F2033B476605C/image-dimensions/268x351?v=v2 "Screenshot 2024-07-22 at 4.35.52?PM.png")


author: Colleen Cosgrove
body: Great!!! thank you so much... how do i reference the fix version from the originating ticket in the comment?


author: Trudy Claspill
body: Information from the issue that triggered the rule can be referenced using the {{triggerIssue}} smart value.

You can find more information about using smart values to reference fields in an issue here:

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/>

Where that document uses **{{issue.** you would use **{{triggerIssue.** to get values from the issue that triggered the rule. Make a note that smart values can be case sensitive so that needs to be a capital "i" for "Issue" in **triggerIssue**


author: Colleen Cosgrove
body: Thanks for the pointers I have tried:

A fix for this ticket has been included in the {{triggerIssue}}  
{{#lookupIssues.fixVersion}}  
{{/}}  
release

and

A fix for this ticket has been included in the {{triggerIssue.fixVersion}}  
release

and neither work?


author: Trudy Claspill
body: Is the rule structure you posted above still accurate? If not, please post new images of your current rule.

If so, there are a few things that are problematic in your comment.

1. The {{lookupIssues}} smart value is used only when you have used a Lookup Issues action. Since your rule doesn't include that action, it is not correct to try to use that smart value.

2. {{triggerIssue}} by itself probably won't get you what you want. That is a higher level entity that includes all the information about the issue. To get data from a specific field, such as Fix Versions, you have to reference that field like you did with {{triggerIssue.fixVersion}}. If you want to print the trigger issue's key you would use {{triggerIssue.key}}, for the Summary use {{triggerIssue.Summary}} and so on.

In what way did you not get the results you wanted? What results did you want? What results did you get?


author: Colleen Cosgrove
body: Here is what I have iand what i get in the linked ticket. n attached pic ![Screenshot 2024-07-23 at 2.09.50?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/337415iD9CFF25D5A179219/image-size/large?v=v2&px=999 "Screenshot 2024-07-23 at 2.09.50?PM.png")

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


author: Trudy Claspill
body: I just noticed you have the wrong smart value. It needs to be fixVersion**++s++**with an "s" at the end.

The Fix Versions field is actually a multiple selection field and each Fix Version has multiple attributes (ID, name, release date, etc.). Is your trigger issue going to have more than one value in the Fix Versions field? Which of the Fix Version attributes do you want to include in your email?


Tags: cloud

jira-cloud