Use case
Prevent issue creation when there is already another issue in the same project with the same value in a certain field.
In this use case let's suppose that we have a text custom field called Invoice wih the internal ID 10400, and we want to avoid this field's value to be repeated among issues of the same issue type in the same project.
โ๏ธ Configuration
Add the Validation based on JQL query to the "Create issue" transition of the desired workflow.
JQL
Add the following JQL query:
Bash
project = "%{issue.project}" AND issuetype = "%{issue.issueType}" AND Invoice = "%{issue.cf10400}"
Validation
Select Number of issues returned by the JQL query satisfies a logical expression .
Expression
Add the following expression:
Bash
{issue.temporaryNumber1} = 0
An alternative implementation of this use case can be done using a
Logical validator, see the following
use case
to see how it can be used.
๐ท Screenshots