Hi.
I want to restrict creation of issues from portal with certain symbols in Summary and Description.
I can put Simple Scripted Validator on workflow creation with
!issue.summary.value.contains("«") && !issue.summary.value.contains("»")
and it works, but how do i use this restriction only for portal request issues creation?
Or please advise how can i use this in Behaviours?
Your code is getting a list of custom fields with the name "multi user picker" and looking at the size of that list.
What you really want to do is get the current value of the field for the current issue try something like
final String customFieldName = "My Custom Field"
def customFieldManager = ComponentAccessor.customFieldManager
def customField = customFieldManager.getCustomFieldObjects(issue).findByName(customFieldName)
assert customField : "Could not find custom field with name $customFieldName"
def customFieldVal = issue.getCustomFieldValue(customField)
def numberOfOptions = customFieldVal.size()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.