Hi,
I would like to increase or de-crease a field value on the parent issue. When sub task transition workflow.
Could not find a script todo this we use JMWE and Script runner.
Many Thanks
Kevin
Hi Kevin,
I think your best bet would be to set up a workflow post-function. The post-function would work something like this:
Does that sound correct?
Hi Joshua,
This is correct, it would increase the count on a custom field on the parent.
Also, if the sub-task is move in error, then the transitioned workflow decrease the count on the perant custom field.
Can you offer any more help?
What help are you looking for?
Hi Nic,
Found these scripts
This one give me the count I wanted:
issue.getSubTaskObjects().findAll {it.getIssueTypeObject()?.getName() == "Project Capitalisation"}.size()
Trying to change this one give me a count of issue type and status:
int numSubtasks = issue.getSubTaskObjects()?.size()?:0if (numSubtasks>0) {int numClosedSubtasks = issue.getSubTaskObjects()?.getName() == "Project Capitalisation".count{it?.statusObject?.name=='Closed'}?:0return (numClosedSubtasks/numSubtasks) as Double} else {return 0 as Double}
Do you have any pointers?
Can anyone offer any help?
Thanks
It looks like you're new here. Sign in or register to get started.