issue Edit screen validation in jira


       I have two custom fields in create issue screen. my requirement is making one custom field required based on another custom field. so i kept some groovy script code in validator for that Transition. So it is working fine in create issue screen.

But now i want same validation for the Edit screen. Where to put the code for the Edit screen. because it does not have transition (Edit screen not comes under workflow). 

My groovy script is


import com.opensymphony.workflow.InvalidInputException
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField

ComponentManager componentManager = ComponentManager.getInstance();
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
CustomField IPRelease = customFieldManager.getCustomFieldObject("customfield_12136");
CustomField IPRecipient = customFieldManager.getCustomFieldObject("customfield_12137");

String IPReleaseval = (String)issue.getCustomFieldValue(IPRelease);
String IPRecipientval = (String)issue.getCustomFieldValue(IPRecipient);

if (IPReleaseval == "Yes") {

if (IPRecipientval == null) {
InvalidInputException e= new InvalidInputException();
e.addError("IP Recipient must not be empty");
throw e;


Please help me to solve this.

Thanks in advance

1 answer

1 accepted

This widget could not be displayed.

JIRA doesn't expose the hooks you need to be able to do "edit validation".

Script runner does though -

Be aware that it is only a partial implementation though - because JIRA doesn't have the internal structure for edit validation, there are places where even the script runner can't do it - your validators will be ignored if you change issues in Agile or use bulk edit for example.

I didn't found the enable switch for the script listeners. Where can I do this? I have the latest version of script runner

This all got moved to 'Behaviors'. Go to Add-ons and select Behaviors on the left. 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

128 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you