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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager 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
}
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.