Automating a status change based on a field located on the parent.

Suzanne Williams
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!
January 8, 2025

I am trying to create an automation using the following:

1) Trigger: status change on child (story)

2) Condition: Parent custom field equals a value

3) Action: change status on child again

dt.png

 

When I check the JQL, I receive the following message:

dt2.png

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2025

Hello @Suzanne Williams 

Welcome to the Atlassian community.

There are three things to look at in your rule:

1. To reference the a field in the Parent of the trigger issue you need to use Smart Values.

https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/

2. You can only use such values on the right side of a criteria in JQL. What goes on the left side is the actual name of the field.

3. When you use a JQL condition, that will be used to evaluate if the issue in focus (the trigger issue) matches the criteria.

 

Ultimately the JQL Condition is not the right choice for you.

 

To accomplish what you want you need to instead use a Smart Values condition,

Screenshot 2025-01-08 at 10.02.49 AM.png

 

Screenshot 2025-01-08 at 10.03.33 AM.png

 

In the top field you identify the field that you want to evaluate. In your case you want to evaluate the a field in the parent of the trigger issue.

Note that smart values are enclosed in double curly braces:

{{ }}

The first component of the smart value is your starting point - the trigger issue:

{{triggerIssue}}

Then you want to get to its parent issue. You can do that by looking at its parent attribute.

{{triggerIssue.parent}}

The last step is identifying the field in the issue. You can use either the human readable name of the field, as you see it when you are viewing issues, or you can use its custom field id. I am assuming that "ALM" is the name of the field as it appears in the issue view when you look at the parent issue, so you could use:

{{triggerIssue.parent.ALM}}

When using a field name it has to be an exact match for the actual case and any spaces used in the name.

Plug that in and then select the criteria for the evaluation.

Screenshot 2025-01-08 at 10.08.31 AM.png

 

And finally enter the value you want to compare to that field.

Screenshot 2025-01-08 at 10.09.49 AM.png

 

If you are new to Automation Rules, you may want to avail yourself of the free on-demand training available on that topic in the Atlassian University.

 

https://university.atlassian.com/student/catalog/list?search=jira+automation

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2025

Hi @Suzanne Williams -- Welcome to the Atlassian Community!

Yes, and...to Trudy's suggestions:

 

You describe wanting to test a custom field in the trigger issue's parent before the rule transitions the trigger issue.

When an issue has a parent reference, such as {{issue.parent}}, only some of the parent's fields are immediately available, such as key, summary, status, etc.  If all of the parent's fields were available, you could imagine a scenario where a tree of linked issues would pull in the data for many others!  For example, {{issue.parent.parent.parent.yourField}}

The only way to know if your field is immediately available is experimentation, such as writing {{issue.parent.yourField}} to the audit log and observing the results.  If it has a value, it works as needed.

If not, your rule could instead use the Lookup Issues action with JQL to first load all of the fields for the parent, and then reference data from the lookup results: {{lookupIssues.first.yourField}}

 

Kind regards,
Bill

Like Trudy Claspill likes this
Suzanne Williams
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!
January 8, 2025

Thank you!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2025

Very good points @Bill Sheboy !

I always forget that some fields in a related issue, like parent, can't be referenced in that manner.

Suggest an answer

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

Atlassian Community Events