Hi Guys.
From a task postfunction, I need to access custom fields in the subtasks.
I am using scriptrunner cloud postfunction scripting option.
This is the code that loops through the subtasks and attempts (unsuccessfully) to catch the values of 3 custom fields:
// loop through subtasks and accumulate table information
subtasks.each { subtask ->
logger.info(subtask.toString())
resources = issue.fields[resourcesCFId] as String //Total hours of HTS equipment used (numeric)
charged = issue.fields[chargedCFId] //Is Charged (checklist)
order = issue.fields[orderCFId] //Order Number (text)
logger.info("resources1: ${resources} ")
logger.info("charged: ${charged} ")
logger.info("order: ${order} ")
temp = ' \n ' + '|' + 'xxx' + '|' + resources + '|' + charged + '|' + order + '|';
logger.info("temp: ", temp.toString())
output = output + temp
logger.info("output: ", output.toString())
}
From the results I see that I am looping through the subtasks but I seem to be catching the values from the parent and not the subtasks.
When I try "subtask.fields", it is not accepted.
image2017-2-21 12:30:42.png
I tried rest api but there was not successful getting to the subtasks.
I would truly appreciate some help here with working syntax.
Thanks!