Forums

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

How to stop creating duplicate tickets when using JWT create issue post function

Aaron Andrade
Contributor
December 7, 2021

We attach Hard Drive property tags to our laptop/desktops tickets and when the laptop/desktop goes online it creates a Hard Drive ticket and puts the property tag number as the summary of the ticket. When we have to recommission the laptop/desktop they go into an offline status. Then when put them back online it creates another Hard Drive ticket. What I need to happen is when we put the laptop/desktop back online I need the Create Issue (JWT) to look and see if that Hard Drive ticket already exists and if it does not make another ticket.

2 answers

1 accepted

1 vote
Answer accepted
Thorsten Letschert _Decadis AG_
Atlassian Partner
December 7, 2021

Hi @Aaron Andrade,

What you're trying to achieve should be doable using the conditional execution feature paired with the issuesFromJQL() function.

Your expression might look something like this with 12345 being the custom field ID of your property tag field:

count(issuesFromJQL("type = 'Hard Drive' AND summary ~ '" + %{issue.cf12345} + "'")) = 0

Adding this expression ensures, that the post function is only executed if no 'Hard Drive' issue already exists where its summary matches the property tag.

Cheers,
Thorsten

Aaron Andrade
Contributor
December 7, 2021

This worked out perfectly thank you for the help!

Like # people like this
0 votes
Frank Leclerc [Decadis AG]
Contributor
December 7, 2021

Hi Justin,

if there are parameters within the issue, by which one can recognize that a ticket already exists, then we can determine this, e.g. with the expression issuesFromJQL("JQL").

So we could solve this with a conditional execution within the Create Issue Post function, e.g. count(issuesFromJQL("JQL")) > 0.

But to be able to help you properly, you would have to describe the use case in more detail and best enrich it with screenshots, in which the whole thing can be reproduced for us.

You are welcome to create a ticket in our support portal.

Cheers,
Frank

Suggest an answer

Log in or Sign up to answer