I am working on an automation to create a task from a sub-task. The tricky part is that I want the grand-parent of the sub-task to the be parent of the new task I am creating. I'm not sure how to retrieve the grandparent task to use it in an automation rule. Is this possible? and if so, how?
Hello @Angie Adams
You should be able to use
{{triggerIssue.parent.parent.key}}
to get the key for the "grandparent" issue assuming that the subtask is the rule trigger issue.
You could use that smart value to set the Parent field for the me issue you create. You may want to add a Log action in your rule to print the value into the log so that you can confirm the rule got the value you expect. You may also want to add a Condition to check that it actual has a value before you try to use it in your new issue.
Thanks, @Trudy Claspill the value was actually logged, but the generating the task caused an error creating the issue "Could not find issue by ID or Key. (parent)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill I did some more testing & found that {{issue.parent.parent.key}} worked. Thanks for pointing me in the right direction. I haven't figured out the rhyme or reason for why triggerIssue works in same cases and in others it has to be issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Angie Adams
The reason for that difference is the {{triggerIssue}} always refers to the trigger issue and {{issue}} is relative to the location in the rule flow.
For an example, please consider this sample rule...
For these reasons, it is helpful to post images of your complete automation rule and the audit log details with a question. They provide context to help the community offer better suggestions.
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.
@Bill Sheboy I appreciate the explanation. Automation is relatively new to me with majority being manual triggers to create a new issue. In this example, trigger issue in main branch produced the same result as issue in the IF/else branch, but trigger issues was not found - with the action: create new issue. I'm sure it will eventually click - especially with the help of your explanation. It just hasn't yet. the issue.parent.parent.key / triggerIssue.parent.parent.key was what I was really after as i couldn't find that in the documentation anywhere. Appreciate the added info!
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.