Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Project Validator - ScriptRunner

Sagi Gueta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2023

Hello,

 

I've requested to make a validator that will be relevant only for project Alpha & Project Beta. The validator should be that certain field should be filled when transitioned to done.

So if i'll be clear:

When transition to done

If project = Alpha, Beta

Than: validator --> {Field Name} must be filled

Do you know how should i write it in a script? 

 

Thanks!

1 answer

1 accepted

2 votes
Answer accepted
Fabio Racobaldo _Catworkx_
Community Champion
January 18, 2023

Hi @Sagi Gueta ,

welcome to the Atlassian community!

You can take a look to some example at the following link https://scriptrunner-docs.connect.adaptavist.com/jiracloud/validators.html

Btw, you validator should be something like :

if(issue.project.key.equalsIgnoreCase("Alpha") || issue.project.key.equalsIgnoreCase("Beta")){
if(issue.customfield_YOUR_CF_ID_HERE == NULL)
return false;
}
return true;

Hope this helps,

Fabio

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events