Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Check for if an Issue w/ Summary Already Exists in a Project

Vasily Prokhorov October 25, 2019

Our users would like to use a post function to create an issue in a specific project with the condition that an issue with the same summary does not already exist in the target project.

2 answers

1 accepted

2 votes
Answer accepted
David Fischer
Community Champion
October 27, 2019

Hi,

in the conditional execution script, you can use a JQL query to check whether an issue already exists with the same summary:

!jqlSearch("project=PROJ and summary ~ \"${issue.summary}\"",1)
Vasily Prokhorov October 28, 2019

Thanks David!

Would you know how I can write a condition such as:

!!issue.get("SD_Project Name")
AND
!jqlSearch("project=(value of the above field if present) and summary ~ \"${issue.summary}\"",1)

 Thank you for your help ahead of time :) !

David Fischer
Community Champion
October 28, 2019

Sure:

issue.getAsString("SD_Project Name") && 
!jqlSearch("project=\"${issue.getAsString("SD_Project Name")}\" and summary ~ \"${issue.summary}\"",1)
Like Vasily Prokhorov likes this
Vasily Prokhorov October 28, 2019

Perfect!

Thank you David.

Dionisio Valdes H June 8, 2022

Hi community, this solution or similar may be applicable to Jira automation?

Thanks for your reply

0 votes
Ollie Guan
Community Champion
October 25, 2019

Suggest an answer

Log in or Sign up to answer