Hello
I need help!! Getting crazy with this:
We have JIRA Server and ScriptRunner, and we are using JIRA Portfolio.
I want to enforce that the Team field (customField) becomes mandatory whenever a user transitions a ticket from Open to something else. So, I tried to setup a Simple scripted validator with ScriptRunner in the transitions of our workflow.
My code is:
import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.InvalidInputException
def cfm = ComponentAccessor.customFieldManager
def val = cfm.getCustomFieldObject('customfield_12300')
if (issue.getStatus() != "Open" && issue.getCustomFieldValue(val) == "") {
throw new InvalidInputException("customfield_12300",
"The Team field must be set to continue.")
}
However, as I result, I get an general workflow error message when I transition this ticket (independent of the value of the Team field.
Thanks in advance,
Marco
Hi Marco,
Could you get around this problem?
Kind Regards,
Marc
Not really. But we use ScriptRunner Behaviours as a workaround. The Team is mandatory now (for some of our users) independent of the workflow stage.
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.