On the Create Issue screen, I'm using an Initializer function to dynamically change the default FormValue of Assignee based on Issue Type.
This is working fine when I use actual users, but I'm unable to set the FormValue of Assignee back to the "Automatic" option (which has a value of -1)
This works:
getFieldById(ASSIGNEE).setFormValue("bobparker")
This doesn't work:
getFieldById(ASSIGNEE).setFormValue("-1")
Full code is below:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
getFieldById(ASSIGNEE).setFormValue("-1")
Hi Jordan.
I had a few problems with behaviours myself in old versions. Since I'm a dev at the Scriptrunner team I have access to all of its builds. In the new development build it works fine. I would tell you to wait it out. It will work once you update.
If this helped out, please accept answers, so that users know this question has been answered.
Cheers!
DYelamos
Hi Daniel,
To clarify, I'm on the latest (Version 5.2.2). You're saying wait till the next SR release for this functionality?
Thanks!
Jordan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jordan,
That is correct. Please click Watch on the version history page to be notified once released.
Thanks,
Katy
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.