Hi everyone.
We have scriptrunner and use its post-function named "Transition parent when all sub-tasks are resolved".
The final status after parent's transition is not a final status in the workflow, meaning we don't need to set the resolution on the parent. Or, to be more precise, we need to leave it unresolved.
However, when I use the aforementioned post-function (I only choose the necessary transition, without setting any conditions, and leave the "Resolution" field value None) I get this error and it doesn't allow me to update the function.
What could be the problem with that?
Thanks in advance!
Resolution "None" should be correct in my opinion, but if you are forced to set a value on that screen, this might be a workaround:
Alternatively:
Before trying the above... check if you have configured a transition screen with a mandatory resolution field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I thought about that too.
I am afraid this might cause side-effects too. For example, if you're using some filter to find issues resolved in the last week, this workaround might cause the issue to appear in that search because the resolution for that issue was set during last week.
Thought I haven't tried this yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, the transition 81 for the parent uses no screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Something new about that? I have the same error. I've updated the Script Runner version in our test enviroment and have the same results.
Thanks,
Roberto Bittencourt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still doesn't work.
I've had to write my own script for this transition.
Perhaps you may find it useful.
import com.atlassian.jira.workflow.*
import com.atlassian.jira.util.JiraUtils
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
def wtu = (WorkflowTransitionUtil) JiraUtils.loadComponent(WorkflowTransitionUtilImpl.class)
def userKey = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getKey()
def parent = issue.getParentObject()
def subtasks = parent.getSubTaskObjects()
def categories = subtasks*.status.statusCategory
if (parent.getStatus().getSimpleStatus().getName() == "In Progress" &&
categories.every {cat -> cat.getName() == "Complete"}) {
def mp = parent as MutableIssue
wtu.setIssue(mp)
wtu.setUserkey(userKey)
wtu.setAction(81)
if (wtu.validate()) {
wtu.progress()
}
}
This is the script which transitions parent issue from status "In Progress" through the transition with id 81 when the status category for all sub-tasks is "Complete", i.e. work finished.
Of course you need to adjust it a little bit based on your needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the "None" the correct resolution? Maybe try to pick "Unresolved" from the list?
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 think somebody designed it that way. Maybe try workaround? Add another status matching the state if the parent: "Subtasks done", or simply add "Unresolved", but this may cause some confusion when trying to search using JQL, as there will be two of the same resolutions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, actually nope, because it was working fine previously. I don't even know when it started showing this error, to be honest.
Well, adding another resolution seems a bit worrying for me, since there're a lot of filters used in jira for this purpose, and basically Unresolved means that resolution is not set for the issue.
So if I set the Resolution to this new "Unresolved" I am afraid that it might cause side-effects.
The most important question is why is this now not working though it used to work in the past.
Hope to get some response from Adaptivist ScriptRunner members.
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.
You should also check the project settings to see, if "Resolution" field is required. Maybe it's blocking you there.
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.