Using values in table columns in the description section, i want to create sub-task and populate issue summary and description. is this possible?
||Summary||Description||
|Summary of 1st sub-task|Description|
|Summary of 2nd sub-task|Description|
Hello @Vishal Biyani ,
To do this you will need to set up a few layers of logic so that the data can be formatted and then iterated using Smart values and JQL for references in if-then statements in combination with Branch rules and multiple rules to do a looping condition to update all subtasks at the same time. This one gets a bit complicated so I detailed out a full example (all be it a very simplified version) for you but first I recommend checking out these documents for a reference point to the functionality used below:
Depending on what outcome you need in the final form you will want to tweak this a bit possibly using additional custom fields as your staging fields but in this example, I set up all the data conversions and iterations in the description field directly and only added a single custom field to act as a counter of the number of subtasks for some logic.
First, I created a Custom field called counter that is a number field and added it to the project, this field will be used by the story to get the initial formatting in place on the parent issue so that the following subtask creation can be iterated on the initial formatting. In my example the COUNTER field is customfield_10286, but this will be unique for your scenario
In the automation rules I set it up as follows (NOTING in the screenshots below I had the summary and description smart values swapped but in the written-out example, they have been corrected):
issuetype = story
|| Position | Summary | Description ||
| Parent issue {{issue.key}} | {{issue.summary}} | {{issue.description}} |
1
issuetype = Sub-Task
Copy COUNTER From Parent
{{issue.parent.description}}
| Sub-Task {{issue.customfield_10286}} {{issue.key}} | {{issue.summary}} | {{issue.description}} |
{{issue.customfield_10286}} + 1
COPY Description From Trigger Issue
This will take the initial Summary and description in a story and use the smart values {{issue.description}} and {{issue.summary}} and convert the data into the table structure with the headers || Position | Summary | Description || like this
Then any time a new subtask is created it ad the count value for the subtask position (this could also use just the issue key using a smart value {{issue.key}} where I am only adding it for a reference point to position added in relation to the COUNTER field)) and it will copy the parent issues description to the subtask and append on an iteration the sub-tasks summary and description to the existing table data from the parent issues description via the smart value {{issue.parent.description}} so each new Subtask will update the parent with all data and then append new data to the new subtask. like this Parent and subtask view:
Then we would hit a logic issue at this section for additional sub-tasks being added if we only have a single rule as there is no way to connect sub-task 1 to sub-task 2 without a secondary rule to fill the logic so we need to create a second Automation rule to update all existing subtasks with the updated Parent issue data when the new subtask updates in rule 1 so all subtask issues contain the same table data as the other subtask issues.
The Second Automation:
issuetype = story AND COUNTER >=2
Make sure that in the Rule details you select "Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule." for the "Allow Rule Trigger" section
This will then Cascade the changes of the most recently created subtask down to the previously created sub-task issues and in the screenshots below you can see Parent Sub-task 1 and sub-task 2:
Again you can get pretty elaborate with this and use a staging text field as well if you wanted to avoid using the parent description to show the details as well and only have the subtasks showing other subtasks
Hope this helps get you on the right track.
Regards,
Earl
WOW!!! This is really detailed explained.
Thank You. This is really helpful
Regards,
Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In case you just want a different way, I did this:
you can use lookupissues to generate a list with the values you mentioned, and store it in a variable or simply call them from the smart values using {{lookupIssues}} as per https://support.atlassian.com/jira-software-cloud/docs/automation-actions/#Automationactions-Lookupissues
So in my example, I updated the Description using a "list" field, where a table was created with as many rows as items in the list where the first column contains the values:
So I read the issue, and then update description with the following:
{{issue.Description}}
||*Header1*||*Header2*||*Header3*||
{{#<YOURFIELDHERE>}}
|{{.}}| col2 | col3 |
{{/}}
and the output is :
||*Header1*||*Header2*||*Header3*||
|list item1 | col2 | col3 |
|list item2 | col2 | col3 |
...
|list itemX | col2 | col3 |
I hope it makes sense, as I think it's a different way which doesn't require a field called "Counter" which wasn't doable for my project.
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.