Condition/Validator for creating unique issue

I'm having hard time with condition/validator.   
I have a project for HR purposes. Issues in that project = profiles of candidates. Issues summary=Name of candidate.
I need a condition/validator which would check the summary of existing issues in the project and wouldn't allow to create a new issue if there's an existing issue with the same summary=name 

1 answer

0 vote
Tarun Sapra Community Champion Oct 02, 2017

Generally, validator/condition are associated with issue workflows. But in your case you want validation based on already existing issues i.e. you don't want the issue to be created if an issue with a similar summary already existing. 

Thus, in the validation section of the issue. You will need to write a validator which uses issueSearchService and fires an JQL query to check if an similar issue already exists and if it doesn't exist then let the current issue be created otherwise return false and show the message that an issue with similar summary already exists. 

Tarun Sapra Community Champion Oct 02, 2017

Here's the sample code - https://scriptrunner.adaptavist.com/4.3.6/jira/recipes/misc/running-a-jql-query.html 

The searchresults should be nil for validator to be true.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

474 views 1 18
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