Forums

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

Automation When status changes add comment on linked issue

Colleen Cosgrove July 22, 2024

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.pngScreenshot 2024-07-22 at 6.42.40 PM.pngScreenshot 2024-07-22 at 6.44.19 PM.png

 

2 answers

0 votes
Colleen Cosgrove July 23, 2024

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

0 votes
Trudy Claspill
Community Champion
July 22, 2024

Hello @Colleen Cosgrove 

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?

 

Colleen Cosgrove July 22, 2024

they are different projects... i have put what i have so far in the original ticket and the audit of what happens

 

Trudy Claspill
Community Champion
July 22, 2024

Thank you for that additional information, @Colleen Cosgrove 

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

 

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

Colleen Cosgrove July 23, 2024

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

 

Trudy Claspill
Community Champion
July 23, 2024

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

Colleen Cosgrove July 23, 2024

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?

 

Trudy Claspill
Community Champion
July 23, 2024

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?

Colleen Cosgrove July 23, 2024

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

 

Screenshot 2024-07-23 at 2.06.05 PM.png

Trudy Claspill
Community Champion
July 23, 2024

I just noticed you have the wrong smart value. It needs to be fixVersions 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?

Suggest an answer

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

Atlassian Community Events