Hello Jira Users,
I need some help on making some fields required on the resolved transition screen using script runner plugin, to be more descriptive when ever the ticket moves from inprogress to resolved there are couple of fields that we would want them to be required. I designed the transition screen and attached it in the workflows but I cant get the script runner to work by making these required. Need help on this ASAP.
We only have ScriptRunner and no other add-ons..
The following are the field types that I would like to make them required on the transition screen:
Thanks!
You can create a ScriptRunner Simple Scripted Validator with a condition something like the following:
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField field1 = customFieldManager.getCustomFieldObjectsByName("Name of Field 1")[0]
String field1Value = issue.getCustomFieldValue(field1)
CustomField field2 = customFieldManager.getCustomFieldObjectsByName("Name of Field 2")[0]
String field2Value = issue.getCustomFieldValue(field2)
return field1 != null && field2 != null
and an error message like "Field1 and Field2 must not be empty when performing this transition."
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.