Forums

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

Automation: Perform action based on the presence of existing tickets with specific criteria

Kenneth Berg September 30, 2021

Hi

 

I have spent the last week trying to get this to work, but regardless of which solutions I have tried the rule still runs the wrong segment and I am left with canceled tickets.

My use case is:

We have a monitoring job (in our own systems) running every 5 minutes, which sends a mail if a criteria is met. The mail is being sent to Jira Service Desk with a title like "Error Found (2021-09-30)".

If the error has not been fixed within 5 minutes, the same mail is sent - over and over again, untill fixed.

 

The receiving of the ticket, and what to label/change it to, is taken care of, but I am trying to achieve this:

When a mail comes from our monitoring system, check all existing tickets if a ticket is present with summary like "Error Found" (without the date) AND Status it not Resolved/Closed.

If a ticket is present, cancel the new incoming ticket and link to the ticket found.
If a ticket is not present, do nothing.

Even if the JQL returns 0 issues found, the incoming tickets are being cancelled and are not linked to anything.

image.png

 

image.png

 

Can anyone help me achieve my goal of

1) Searching for existing tickets with Summary = "Something" and Status NOT IN ("Statusses")

2) Perform actions on both trigger issue, and found issues, based on this search

 

Thank you

2 answers

1 accepted

0 votes
Answer accepted
Kenneth Berg October 1, 2021

I found the answer! Posting it here, in case someone else stumbles upon this.

So my "Search related issues"-JQL was searching for existing tickets which had the same summary, but were not in a closed status.

Well, the new ticket - on which the rule was running - did match this criteria, so it performed the following actions (involving cancelling the ticket).

I couldn't figure out how to exclude this ticket from the Related issues search, so I added another criteria "Created < -3m", as I know this monitoring job is running every 5 minutes - so the related issue must be more than 3 minutes old, excluding the new ticket.

Hopefully this helps someone :-)

0 votes
Richard Fay September 30, 2021

I think you are overcomplicating things. I suggest the following:

Trigger on ticket creation.

Related issues condition: JQL test for existing open tickets with matching summary.

Edit Fields.

Transition ticket.

Branch rule / related issues: JQL test for existing open tickets with matching summary.

Link to trigger ticket.

 

Cheers.

Kenneth Berg October 1, 2021

Hi Richard

Thank you very much for your suggestion - it is greatly appreciated.

I might have complicated my existing rule a bit, as this is the 5th iteration of this part of the rule.

I have tried what you suggest, but even if no tickets exists (based on matching summary and status not in Resolved, Closed or Cancelled) the new ticket still match this if-condition, which - in my case - cancels the new ticket.

It doesn't link the new issue to any existing issue (rightfully so, as no matching issue exists) so that part seems to be working.

 

I have tried your suggestion and will see how it goes - fingers crossed.

billede.png

Kenneth Berg October 1, 2021

A new ticket was just created and unfortunately made it way through the if statement.

The summary of the new ticket is "Error Found (2021-10-01)" and no open tickets are in the system.

This is the if-statement which it passed

billede.png

billede.png

billede.png

billede.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events