Hello,
I am trying to add a validation which catches 'Caused By Explanation' string inside a multi text field. And throws an exception to show users saying 'Caused By Explanation' is not a valid value.
How to achieve this?
Hi @Teja,
Below snippet may help you
import com.atlassian.jira.component.ComponentAccessorimport com.opensymphony.workflow.InvalidInputExceptiondef cField = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Caused By Explanation")def value = issue.getCustomFieldValue(cField) as Stringif (value == "Something"){ return true}else{ throw invalidInputException = new InvalidInputException("Custom Error")}
BR,
Leo
@Leo Thanks, It worked.
Regards
Tejas Naik
It looks like you're new here. Sign in or register to get started.