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 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()?:0
if (numSubtasks>0) {
int numClosedSubtasks = issue.getSubTaskObjects()?.getName() == "Project Capitalisation".count{it?.statusObject?.name=='Closed'}?:0
return (numClosedSubtasks/numSubtasks) as Double
} else {
return 0 as Double
}
Do you have any pointers?
Many Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Many Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshua,
Can you offer any more help?
Many Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What help are you looking for?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
For ease of reporting I need to have a couple of fields on my parent issue.
The number of sub-tasks of x type
The number of sub-tasks of x type that are completed
I need setup a listener for this can you point me at a script to-do this.
Many thanks just learn JIRA
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()?:0
if (numSubtasks>0) {
int numClosedSubtasks = issue.getSubTaskObjects()?.getName() == "Project Capitalisation".count{it?.statusObject?.name=='Closed'}?:0
return (numClosedSubtasks/numSubtasks) as Double
} else {
return 0 as Double
}
Do you have any pointers?
Many Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.