# Watchers not auto resolving in Pager Duty

**URL:** <https://discuss.elastic.co/t/watchers-not-auto-resolving-in-pager-duty/171651>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [March 11, 2019, 2:05am UTC](https://discuss.elastic.co/t/watchers-not-auto-resolving-in-pager-duty/171651 "2019-03-11T02:05:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandondqm](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@Brandondqm](https://discuss.elastic.co/u/Brandondqm)\
**Post date:** [March 11, 2019, 2:05am UTC](https://discuss.elastic.co/t/watchers-not-auto-resolving-in-pager-duty/171651/1 "2019-03-11T02:05:23Z")

</div>

Hi there

I have built some watchers that fire off to our Pager Duty service, below is an example of a watcher. The alert triggers and works perfectly, however, the issue I am having is that the alert doesn't auto resolve when the threshold is back to normal, I will have to go into pager duty and manually resolve the alert.  
I am guessing that I will need to add some sort of 'condition' to my watcher so that it knows when to resolve the alert, but I am not sure how to achieve this, any ideas of what it would look like? Or maybe there a better way of doing this?

```auto
  "actions" : {
    "pagerduty": {
      "webhook": {
        "scheme": "https",
        "method": "POST",
        "host": "events.pagerduty.com",
        "port": 443,
        "path": "/generic/2010-04-15/create_event.json",
        "body": "{\"service_key\": \"MyServiceKey\",\"incident_key\": \"MyIncidentKey\",\"event_type\": \"trigger\",\"description\": \"Test\",\"details\":{\"alert_source\":\"watcher\",\"description\":\"Test Alert\",\"LogMessage\":\"Something has gone wrong\"}}",
        "headers": {"Content-type": "application/json"}
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 20, 2019, 8:54am UTC](https://discuss.elastic.co/t/watchers-not-auto-resolving-in-pager-duty/171651/2 "2019-03-20T08:54:47Z")

</div>

instead of having a condition for the watch, each action can have a condition. This means, you could have one action that creates a pagerduty alert and another action that marks it as resolved.

You could also have two different watches for this, that might keep the complexity of a single watch down.

--Alex

---

<div class="post-metadata">

**Author:** ![Brandondqm](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@Brandondqm](https://discuss.elastic.co/u/Brandondqm)\
**Post date:** [March 21, 2019, 12:41am UTC](https://discuss.elastic.co/t/watchers-not-auto-resolving-in-pager-duty/171651/3 "2019-03-21T00:41:06Z")

</div>

@spinscale, thank you for your reply. Please can you advise on how this would done? I am still not sure on how the alert will know when the threshold is back to normal so that it fires off an a resolved action.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 18, 2019, 12:41am UTC](https://discuss.elastic.co/t/watchers-not-auto-resolving-in-pager-duty/171651/4 "2019-04-18T00:41:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
