On this page



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, and we want to avoid this field's value to be repeated among issues of the same issue type in the same project.

This use case is based on the Prevent issue creation with the same field value with Validation based on JQL query.


Configuration


Add the Logical validator to the "Create issue" transition of the desired workflow.


Expression

Add the following expression:

count(issuesFromJQL("project = '" + %{issue.project.key} + "' AND issuetype = '" + %{issue.issueType} + "' AND Invoice = '" + %{issue.cfnnnnn} + "'")) = 0


%{issue.cfnnnnn} is the field code for the custom fieldĀ Invoice. You might need to update the expression accordingly to the custom field you want to use.





Screenshots


Related use cases




JWT feature

Workflow function

Logical validator

Validation based on JQL query

Use case descriptionPrevent issue creation when there is already another issue in the same project with the same value in a certain field.
Parser functions

count()

issuesFromJQL()

Label





Status
Tech review

Style guide