How can I set one or more users to the Approvers field with a ScriptRunner behaviour?
I tried setFormValue("user1") but it did not work. Here is the code.
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def approversField = customFieldManager.getCustomFieldObjectByName("Approvers")
approversField.setFormValue(["user1"])
Hello @Michael Müller
To set value on the form via behaviour, you need to get FormField object like this:
def approversField = getFieldByName("Approvers")
approversField.setFormValue(["user1"])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Michael Müller
You're welcome! If it helps you, please mark answer as accepted :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark
Would you be able to show me a simple script to pull the users into the field based on security group?
Preferably with an if statement based on another field. If custom field application type = x then pre fill approvers field with members of X application approvers group.
thanks
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.