I am trying to have a new sub-task automatically inherit the parent's component.
Why is the below automation now working?
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has the rule undergone multiple edits? Sometimes rules stop working for non-obvious reasons after repeated edits. You might try creating the rule a new from scratch.
Can you check if there is more than one field named Component or Components?
Use the information from this page to print all the fields from a sample parent issue and subtask and review the output to see if there is more than one field with that name.
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
You could also try using advanced editing with JSON to copy the values to the child issue.
https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/
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.