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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.