I am trying to have a new sub-task automatically inherit the parent's component.
Why is the below automation now working?
Hello @Darryn
What is the output in the rule execution log?
Is the rule scope a single project or multiple projects?
What do you see in the Components field for the issue that triggered the rule?
Hi @Trudy P Claspill
Do you mean the "audit log" when you say output in the execution log? Honest question, I can't find a "rule execution log" - the Audit log says:
The scope is just a single project.
On all test issues I've created (including KM-547 above), the Component field value has remained "none"...
Yes, indeed, I did mean the log for the individual execution of the rule, which is found on the screen labeled Audit Log when viewing the rule. You provided what I was asking for.
I am assuming you have confirmed manually that the Components field in the parent issue is not empty.
What is the project type for the project against which the rule is running? Get that information from the View All Projects page under the Projects menu.
Can you use the Log action just before the Edit action to print into the audit log the value of the Components field from the parent issues? You can access that value with
{{issue.parent.components}}
Then create a new subtask and let us know the audit log output.
Great.
Yes, the parent has a component (we use components as our different boards in our team)
Project Type: company managed software
I added log action with {{issue.parent.components}} and it appeared as an ID number! So I changed the code to {{issue.parent.components.name}} and it now appears as the name of the parent's component.
I also change my Then: Edit Issue fields to use code {{ parent.fields.components[*].name }} but even this didn't work - the components on the new sub-task are still 'none'.
Hi @Darryn
Looking at the original rule you posted, it uses the Issue Created trigger. That trigger may fire so quickly that some data may not yet be available to the rule yet. This particularly applies to smart values like {{issue.parent}}, {{issue.subtasks}}, etc.
The "fix" for that timing problem is to always add the Re-fetch Issue action immediately after the Issue Created trigger. This will slow down the rule a bit and reload the data before the rule continues. Please try adding that action and re-testing.
Kind regards,Bill
It looks like you're new here. Sign in or register to get started.