We have a requirement where in alerts will be created via email integration in Opsgenie when some service is down and once the service is back it will trigger another email and it will have something in the email body saying the status is ok. So can we match this and close the alert automatically in Opsgenie.
I tried all the options to match text in Subject, Message in Advanced option in integration but no luck, it keeps on adding the ticket count instead of closing it.
Hi @Chethan GR ,
This use case is certainly possible! It's all dependent on the alias field - or the alert's unique identifier - of both the create and close alerts.
In order for the integration to close an alert, it needs to find an open existing Opsgenie alert with a matching alias. You can define what data parsed in the alias field of both actions - but again, the key is they need to match.
Here's a very basic example:
Hope this helps! Here's a few other documents customers leverage to help customize what data parses in the alias or other alert fields:
Let us know if you have any additional questions.
Hi @Chethan GR ,
That setup looks good - so I have to assume the second email is in fact containing "Down" in the subject - which is why it's deduplicating.
If that's the case then the alert will continue to use that action since it matches. You need to filter on something that does not match the Create Alert action's filter - and has the opportunity to review the Close Alert action.
Otherwise, the alerts will continue to deduplicate like this.
Hi @Nick H
I am also getting alerts deduplicating because of the alias being the same. Isn't this is what distinguishes alerts? Shouldn't both emails both have the same alias?
Initial email has subject of "State: DOWN"
Second email has subject of "Server is now OK"
I have my closing alert to have the exact same settings you instructed but I still get deduplicating
Hi @tabpws ,
Yes - the alias is the unique identifier of an alert and helps Opsgenie distinguish whether or not an alert should be deduplicated, closed through an integration, etc.
If your alert is deduplicating instead of closing the alert, then it's matching on an integration's Create Alert action - so Opsgenie does not have the chance to review the Close Alert action(s).
All of the actions listed in an integration follow an order of operations. Opsgenie will review these actions from top >> down starting with the Ignore actions >> Create >> Close >> Ack >> Add Note. So order matters because once Opsgenie matches on an action, that action will be used.
If your alerts are still deduplicating, but should be closing, you'd probably have to add another condition into the Create Alert action - maybe something that does NOT contain a piece of data. You can reference my last response at the bottom of this Community post.
What do you mean "adding to the ticket count"? Adding new messages via deduplication (I assume).
You would need to match your close criteria and then create a Close action in the integration, rather than under the Create Alert tab. Even with that, its still not working?
Hi @Chethan GR ,
I reviewed a previous screenshot of yours, and like I had mentioned - "That setup looks good - so I have to assume the second email is in fact containing 'Down' in the subject - which is why it's deduplicating" - that did appear to be the case:
So your integration's Create Alert action would be matching on that since Subject Contains "Down" - even though "Okay" is also in the subject as well.
You'd want to add an additional condition to the Create Alert action's filter to avoid deduplicating on these alerts. That'd look something like this:
In the past, managing IT infrastructure was a hard job. It required a lot of manual effort and it was hard to keep track of all the necessary information (monitoring, scalability etc). Thankfully, as...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events