Hi Team,
I wanted to make a custiomfield "DONTKNOW" mandatory on Resolve transitions for only 3 issuetypes.
if customfield "DONTKNOW" = (paricular value say else) "Else" then custom field should be mandatory.
Your subject states that you "need a script" - does that imply that you have an app that supports scripting, such as ScriptRunner or JMWE?
Yes, I have both.
Cool. With those apps, you can create a scripted validator with code something like the following (it's not tested, but should be pretty accurate.)
import com.atlassian.jira.issue.CustomFieldManagerimport com.atlassian.jira.issue.fields.CustomFieldCustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()CustomField dontKnowField = customFieldManager.getCustomFieldObjectsByName("DONTKNOW")[0]String dontKnowValue = issue.getCustomFieldValue(dontKnowField)String issueTypeName = issue.getType().getName()List issueTypes = ["Issue Type 1","Issue Type 2","Issue Type 3"]if(issueTypeName in issueTypes && dontKnowValue == ""){ return false}else{ return true}
It looks like you're new here. Sign in or register to get started.