Condition/Validator for creating unique issue

Nick Hizenko October 2, 2017

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 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 2, 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 2, 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.

pradeep km April 7, 2022

We user "dd123" , "dd321" as a summary but sometimes duplicates will be created with same summary.
I want to create always unique summary "ddxx" with unique number if i give same number it should throw error message  is it possible to achieve without scriptrunner plugin.

Suggest an answer

Log in or Sign up to answer