I am trying to use the transition issue post function and want it to only occur if there are no subtasks for that issue.
I have checked the box "Only if condition is true", but I am unsure what my expression would be to look for subtasks?
Basically I would want it to say something like:
If no subtask for current issue {
Return true
}
Try this?
def subTasksList = issue.getSubTaskObjects()
if (subTasksList.size() < 1) {
return true
}
I see this error:
No signature of method: com.innovalog.jmwe.IssueProxy.getSubTaskObjects() is applicable for argument types: () values: []
groovy.lang.MissingMethodException: No signature of method: com.innovalog.jmwe.IssueProxy.getSubTaskObjects() is applicable for argument types: () values: []
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using Cloud or Server? The above script worked for me using JIRA Server 7.x with the following post function configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using JIRA Server 7. Does there not need to be some kind of reference to a class at the top or something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try adding these two lines to the top of the script.
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up using a built in script to fast-track a transition. For the condition I used "issue.getSubTaskObjects().size() < 1" and it worked.
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.