How to write a validator in JIRA?

Hello All,

I want to write validator that check if all linked issues have one special resolution.

I have tried using "Script Validator" but I don't know how to do this.

Can anyone help me?

Greetz Nils

2 answers

Hey Nils,

You can use these tutorials here to write your own plugin validator.

If not use the script runner plugin

Your code will look something like this.

Collection<IssueLink> links = ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId());

for(IssueLink link:links){

Issue linkedIssue = link.getSourceObject();


return false;






Using the following code you approach further

import com.atlassian.jira.component.ComponentAccessor;
import java.util.Collection;
import com.atlassian.jira.issue.Issue;
import com.opensymphony.workflow.InvalidInputException;
IssueLinkManager ilm=ComponentAccessor.getIssueLinkManager();

JiraAuthenticationContext authContext=ComponentAccessor.getJiraAuthenticationContext();

LinkCollection lc=ilm.getLinkCollection(issue, authContext.getLoggedInUser());

Collection&lt;Issue&gt; issues=lc.getAllIssues();
InvalidInputException e=new InvalidInputException();
for(Issue issue: issues)
   if(issue.getResolutionObject().getName().equals("&lt;specific name&gt;")==false){
e.addError("Resolution should be &lt;specific name&gt; for all linked issues");
   throw e;

you can do more customizations like by placing all issues in a collection(which are having resolution other than your specific name) and throw as error message.

Also go through my answers in

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

59 views 0 5
Read article

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