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
When I check the JQL, I receive the following message:
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,
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.
And finally enter the value you want to compare to that field.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very good points @Bill Sheboy !
I always forget that some fields in a related issue, like parent, can't be referenced in that manner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.