Script Runner simple scripted validator like

Thomas Landuyt April 12, 2016

Hi,

 

I was trying to set up a simple scripted validator. Something like this

 

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectByName("Main URL")

issue.getSummary() !~ 'hotfix' &&  issue.getCustomFieldValue(cf) == ""

 

now he doesn't recognize the ! mark. is there a way to do something like a like mechanisme?

1 answer

1 accepted

0 votes
Answer accepted
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2016

Hi Thomas

So, if you want to check if the summary contains the word 'hotfix', you will need something like

issue.getSummary().contains("hotfix")

Hope that helps

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events