I have written a JIRA automation rule with the intent that if hours are logged against a subtask, then rule should trigger and add aggregatetimespent available at epic level for all standard Issues under the epic.
the rule is updating the field at sub-task instead of Epic.
Need help to fix. This is my rule
When Work Logged
Branch
For Current Issue
if issuetype in subTaskIssueTypes()
Used lookup issues:
"Epic Link" = {{ triggerIssue.parent.parent.key }}
Saved {{#=}} {{lookupIssues.aggregatetimespent.sum}} / 3600 {{/}} to a variable
Used lookup issues: key = {{ issue.parent.parent.key }}
Then Edit issue and update the custom field. However, the current field i.e. subtask is getting updated instead of epic.
How to fix this?