Automating creation of a st of subtask that changed depending the value of another field

Flavien Gache
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2025

Hello everybody. I am asking for your help for this matter.

 

I need to automate the creation of subtasks on a project.

Process looks like this : 

1) User chooses an option on a "Product" custom field.

2) Depending on the option, a certain number of substasks are created.

 

Example

Possible values for Product :

- Square

- Circle

If square is choosen, I need to create four subtasks named Tomorrow, Phone, Chair and W.

If circle is choosen, I need to create three subtasks named James, Jones and Martin. 

 

Things would be simple if there was not about 100 hundred options for "Product". Each option can create between 2 and 5 subtasks whose name changes for each option.

 

My solution was to create a template project that is going to nest every possible subtask and to build an automation that would create some of the subtasks depending the option choosen for Product, but I have two issues : 

1) Isn't there another, simpler option (cascading fields, etc...) ?

2) My client does not have Premium and I think I will have a hard time trying to convince them to upgrade.

 

Feel free to ask me for details.

Thanks in advance for your help.

1 answer

2 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2025

Hi @Flavien Gache 

Assuming your subtask content does not have a lot of variation for each Product's subtasks, this could be tried with an automation Lookup Table.

For example:

  • trigger: field value changed for "Product"
  • action: create lookup table
    • name: varProductToSubtaskSelections
    • row
      • key: Square
      • value: Tomorrow, Phone, Chair, W
    • row
      • key: Circle
      • value: James, Jones, Martin
    • row...
  • [optional] -- perhaps add a related issues condition with JQL to check if the subtasks were already created by a prior rule execution
  • advanced branch:
    • name: varSubtaskSelections
    • value:  {{varProductToSubtaskSelections.get(issue.Product.value).split(", ")}}
      • action: create the subtask

 

  • [optional] smart values condition: Use this to detect missing table rows
    • first value: {{varProductToSubtaskSelections.get(issue.Product.value)}}
    • condition: equals
    • second value: leave as empty
  • [optional] action: send email to rule maintainer that something is wrong with the lookup table

 

If there is a lot of variation between the subtasks, one could add additional data to the lookup table, perhaps storing it as JSON, and use the new jsonStringToObject() function to decode it.

 

Kind regards,
Bill

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2025

@Bill Sheboy I haven't used lookup tables like that before, but I'm guessing that since you can only have 20 rows in a lookup table @Flavien Gache  would have to create several tables and maybe multiple automation rules for the 100+ options for Product

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2025

Hi @Stephen_Lugton 

The documentation is incorrect as Lookup Tables now support up to 200 rows, per this article from Atlassian on the latest round of updates in July 2023: https://community.atlassian.com/t5/Automation-articles/Update-Create-lookup-table-action-improvements/ba-p/2427798

The action's UX is a bit tricky to use as it pages every 20 rows.

 

The other possible workaround is using an attachment:

  • create a CSV file with the mapping, attaching it to a specific, known issue
  • use the REST API to read the attachment from that known issue
  • parse the web response to get the data for the specific Product using match(), and...
  • advance branch over the values

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer