I have recently integrated opsgenie to Jira integration to get the tickets for alerts in opsgenie. But the issue is there is a lot of noise since there are same alerts again and again and similarly tickets are generated for the same alerts. There should be one ticket for the same alerts and not duplicates. Any idea on how can that be done in opsgenie or Jira side?
I did this through Webhook and AWS Lambda. So how it works is it posts to REST API endpoint which is AWS Lambda and there is a Python script in AWS lambda which processes the Opsgenie request and searches the Jira with some parameters. I will post a link to the script and describe its functionality in a day or two.
The script finds an issue, if it does not get one it makes one and if it finds one it adds the alert link to the comments section of an already existing ticket
The key to this is you want to "de-duplicate" the alert in opsgenie, so that only one opsgenie alert is created.
opsgenie uses the "alias" field to determine if two alerts are for the same event. If they have the same alias, and there is an open alerts for the alias, a new one will not be created.
So what you want to do is see what the alias field is set to currently, and modify it to allow it to be the same for the same alerts.
Exactly how to do this is very dependent on the opsgenie integration and how the alerts are being created, so I cant give you specifics.
However, Opsgenie support is VERY helpful at helping you to create the right rules. I'd suggest reaching out to them (even via the chatbox on thier site) and asking for thier assistance in building the alias.
Hey @Andrew Laden
Thanks for the reply. The issue is that I am talking about the Jira side. I understand about the Alias concept that opsgenie uses. The use case is that if you get an alert a ticket is created in opsgenie. Now after some time the alert gets closed and then opens again after lets say X hours. The ticket on the Jira for that alert is already there and it again creates a new one since its a new alert right.
So I wanted to see that if an issue exists in Jira -- for an alert lets say ABC no matter how many times the alert ABC flaps -- there should be no duplicate tickets in Jira for the alert ABC if it comes lets say 4 times a day.
I hope I made it clear. Thank You !!
Thats a little harder. The general model is 1 jira issue to 1 opsgenie alert. If you want a model of many opsgenie alerts to 1 jira issue, you are going to have to do that yourself.
Are you using OEC to generate the jira issues from opsgenie? or are you using the native integration. If you are using OEC, you could theoretically write some validation code in that could search jira for an open issue matching your parameters and if found change to a comment operation instead of a create, but its going to take some work to get that right.
Yeah, that's what I thought as well. I am currently using native integration. I guess I will have to switch to OEC and write a script to call Jira API and search for the issues and if that exists then there is no need to make another ticket.
Do you think this could be useful?
Not really. I suppose you are thinking of having the email from opsgenie create the ticket instead of the integration?
You would actually make your situation worse. When an email comes in, jira tries to figure out if it should comment on an existing ticket, or open a new one. There are a few ways it tries.
1: Looks for an jira issue key in the subject of the email
2: looks for "in-reply-to" or "in-response-to" headers, and tries to match up to a previous email.
Neither of these will match, so every mail from opsgenie will create a new issue.
The built in jira email handler isnt very configurable.
If you have a add on email handlers (JEMH for example) you could write some custom handling to try to match a mail up to an existing issue. Would probably be harder them the OEC solution.
Hey, @Andrew Laden I did this through Webhook and AWS Lambda. So how it works is it posts to REST API endpoint which is AWS Lambda and there is a Python script in AWS lambda which processes the Opsgenie request and searches the Jira with some parameters. I will post a link to the script and describe its functionality in a day or two.
The script finds an issue, if it does not get one it makes one and if it finds one it adds the alert link to the comments section of an already existing ticket.
We’re excited to announce the latest enhancement to Opsgenie’s Incident Investigation view. Now when an incident occurs users can select the previous stable deployment, and begin the redeployment pro...
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