I would like to use Jira automation to propagate a text field from all sub-tasks to the parent. Let's assume it's a "status update" field. I'd like the field from each sub-task to propagate to the parent ticket and include formatting.
I am including below what I'm currently attempting but:
a) The formatting doesn't work
b) It prints out each sub-task key then each issue summary and then each issue status update instead of the desired result of first sub-task key, first sub-task summary, first sub-key update and so on.
h1. {{issue.subtasks.key}} - {{issue.subtasks.summary}} - {{issue.status update}}
h4. {{issue.subtasks.status update}}
Additionally will it be possible to make this field read only on the parent task?
By using {{issue.subtasks.*}} you're going to bring in information from all subtasks. You'll likely need to use branching or list behavior to retrieve only what you want to see (e.g. {{issue.subtasks.key.get(0)}}. Can you please share a screenshot of the rule so we can have further context into the issue you're facing and help determine the right solution?
As for the second part of your question... To Make the field read only on the parent task, you'd need to do something like this:
The combination of the steps above will enable you to make the field view only when generally navigating. Automation would then perform a transition to set the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So if you're only looking to capture information on the sub-task that triggered this issue, you'd change up your smart values to look like this:
h1. {{triggerIssue.key}} - {{triggerIssue.summary}} - {{triggerIssue.status update}}
h4. {{triggerIssue.test guidelines}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd like to capture the information from all subtasks.
The parent field should always contain the text from ALL the subtasks field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the example above with test guidelines, assignees will enter test guidelines on each sub-task. They will then be propagated to the parent ticket and be shown as:
Sub-task 1:
Test this
Sub-task 2:
Test this
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it... Thanks for the added context.
You should be able to do something like this:
{{#}}{{issue.subtasks}}
h1.{{key}} - {{summary}} - {{customfield_10602.distinct.AsJsonArray.remove("[").remove("]").remove("\")}}
h4.{{test guidelines}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I took out the customfield to simplify as it wasn't relevant... I am unfortunately getting an error with it
Error rendering smart-values when executing this rule:
Token is empty: {{#}}{{issue.subtasks}} h1.{{key}} - {{summary}} h4.{{Test Guidelines}} {{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
whoops syntax error on my part. Sorry!
{{#issue.subtasks}}
h1.{{key}} - {{summary}}
h4.{{Test Guidelines}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much. It now works as expected :).
A couple more questions for you if you don't mind:
1. Where am I able to find documentation about the {# and {##}, I don't quite understand what is going on :(. Googling such terms is not easy :)
2. "As for the second part of your question... To Make the field read only on the parent task, you'd need to do something like this:"
Do you have any suggestions on where I can find more information about this, once again Google has failed me and I don't understand the 4 steps you outlined and how they accomplish what I need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Where am I able to find documentation about the {# and {##}, I don't quite understand what is going on :(. Googling such terms is not easy :)
Here's the official documentation on it. Note the navigation links at the top right of the screen are very useful for a broader understanding of Smart Values. I have it bookmarked myself.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/
2. "As for the second part of your question... To Make the field read only on the parent task, you'd need to do something like this:"
Do you have any suggestions on where I can find more information about this, once again Google has failed me and I don't understand the 4 steps you outlined and how they accomplish what I need.
This is really a culmination of a bunch of different functionality in Jira and I'm not sure that there's any documentation that links all of it together. As long as you have an understanding of the below key configuration areas, it's just a matter of making them work together in the right way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am trying to do the same with a custom Select List (single choice) field (id=10083) from the sub-tasks into a custom Text Field (single line) on the parent task/story (along with the sub-task issue key & summary).
When I try the following for the Edit issue field component for the parent within the automation rule,
{{#issue.subtasks}}
h1.{{key}} - {{summary}}
h4.{{"value": customfield_10083}}
{{/}}
it produces the following error.
Any help on this would be much appreciated!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're close... It would be this:
{{#issue.subtasks}}
h1.{{key}} - {{summary}}
h4.{{customfield_10083.value}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark Segall
Thank you for the super prompt response! It looks like I'm getting a different kind of error ("Error while parsing additional fields. Not valid JSON.") with the above-mentioned edit.
I am very new to automation, so I'm wondering if I've made a fundamental misstep somewhere...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the delay, I've been on vacation the past week. So that this question doesn't get cluttered, can you please create a new question (you can @mention me to ensure I don't lose visibility) and include a screen shot of your edit issue action. I was just re-reading your question and there may be a bit of a difference between your configuration and the original question here.
Thanks!
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.