Can we override exiting alerts configured in Opsgenie based on a flag/update from a JIRA ticket ??
Asked by Manohar Goli (Dnfcs):

We have a use case to stop sending alerts for a specific application, if we there is a planned downtime for that application and we pass this downtime info to Opsgenie via JIRA ticket.

Can we configure these rules into Opsgenie and use its integration with JIRA for passing this info??


Answers:
author: Kate Clavet
body: Hi [@Manohar Goli (Dnfcs)](/t5/user/viewprofilepage/user-id/1060164) If you don't want to receive alerts from these applications when there is scheduled maintenance/downtime but still want to receive other alerts for those applications in other scenarios the best way to go about this would be to use the Alert and Notification Policies in Opsgenie. I'll use Jira for this example.

From within the team that the Jira integration is assigned to, click on the policies tab.

![Screen Shot 2019-06-21 at 12.07.13 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/58395i3AA9454D71FA74BB/image-dimensions/578x334?v=v2 "Screen Shot 2019-06-21 at 12.07.13 PM.png")

First, set up an alert policy to add the tag "maintenance" to any low priority alert coming from Jira with the maintenance in the message. (You can adjust the parameters to make sense for your use case, this is simply what I used for the example.)

![Screen Shot 2019-06-21 at 12.08.38 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/58396i6CBA8ACF8E8FCEA8/image-dimensions/504x424?v=v2 "Screen Shot 2019-06-21 at 12.08.38 PM.png")![Screen Shot 2019-06-21 at 12.08.49 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/58397i0FC89E082BF5284B/image-dimensions/503x421?v=v2 "Screen Shot 2019-06-21 at 12.08.49 PM.png")

Now every alert relating to scheduled maintenance coming from Jira will automatically be assigned the tag "maintenance."

Next from Notification Policies, set it up so that every alert coming from Jira, that has the maintenance tag is automatically closed.

![Screen Shot 2019-06-21 at 12.07.02 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/58398iF37563D05C09E130/image-dimensions/607x506?v=v2 "Screen Shot 2019-06-21 at 12.07.02 PM.png")

Hopefully this helps!

comments: author: Manohar Goli (Dnfcs)
body: [@Kate Clavet](/t5/user/viewprofilepage/user-id/2156162)

Thanks for the detailed response. This is definitely helpful. However the requirement our client is to further automate this whole scheduled maintenance for planned changes. For example, an application ( already configured for alerts on Opsgenie) that is part of a change request (jira ticket), is there a way to trigger a change (may be use web hook from JIRA to Opsgenie) to Alert profile of that particular application for that particular maintenance period (again this info is recorded on Change request (JIRA) and passed on as update to Opsgenie)

Challenge which they are trying to address is to avoid manual changes to alert profile when there is a scheduled maintenance for a specific application.


author: Kate Clavet
body: Yes [@Manohar Goli (Dnfcs)](/t5/user/viewprofilepage/user-id/1060164) Unless I'm misunderstanding your use case, you would still set up alert policies and notification policies, this way every time an alert came through related to that scheduled maintenance it would be tagged as scheduled maintenance thanks to the alert policy, and trigger an auto close thanks to the notification policy. Once it is set up, there is no manual intervention moving forward.

Meaning if Jira sends an alert to Opsgenie that scheduled maintenance is taking place, Opsgenie will add the tag maintenance automatically and then trigger the notification policy telling the alert to auto close.   

You may need to adjust the tags or alert source used for your particular use case (only during the initial set up of the policy) but this is still the solution. Let me know if I'm misunderstanding your use case :)