Hi
I do have a requirement to make a condition so that customfield_14173 should be required if priority is set to a blocker or critical in service desk form. Am new to scripting, am not sure where to use the script and what to script. Any help us much appreciated.
I tried this in field behavior on the custom filed to be set to required
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
def vp = getFieldById("customfield_14173")
def priority = getFieldByName("customfield_priority")
if(priority.getValue()==("Blocker") || ("Critical"))
{
vp.setRequired()=true
}
Any help , will this behaviour work in service desk?
Thanks
KRC, did you try with an custom script validator on the create transition?
No, behaviours are written in a different language than things internal to Jira. They use javascript, conditions and other internals need to be done in Groovy or Java.
At a glance though, it's only the set-required that won't work. For a validator, you'd simply return "true" if the entry is ok, and "false" with an error message when it's not.
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.