Hi
I'm trying to do something with automation but think it can't be done so I'm looking for advice. What I need to do:
- An issue can have between 1 and 6 subtasks.
- There is a custom field select list with values 0 to 10. This field is on the subtasks and on the parent.
- The field is not editable on the parent. The parent should take the highest value from its subtasks.
The trigger is not a problem - could be a workflow transition or a field edit or even scheduled.
Converting the strings in the select list to numbers for maths is not a problem.
The problem is how to get the highest value from the subtasks. Lookup cannot access custom fields. I have tried using a variable for each potential subtask and then branches but this doesn't work because the branches don't run sequentially, and I can't put the main branch on pause until all the other branches have completed. Advanced compare between the subtask's value and the parent's value doesn't work because we need to compare the values from all the other subtasks.
Does anyone have any suggestions?
If this can't be done with automation, I guess it could be done with Script Runner, looping through the subtasks, putting the values in a list, sorting it, and then putting the highest value in the parent? I don't have Script Runner but would do a trial if necessary so any suggestions on docs, tutorials etc also welcome.
Thanks!