# "contexts" is not accepted for pagerduty integration configuration

**URL:** <https://discuss.elastic.co/t/contexts-is-not-accepted-for-pagerduty-integration-configuration/109711>\
**Category:** Elasticsearch\
**Created:** [November 30, 2017, 9:08am UTC](https://discuss.elastic.co/t/contexts-is-not-accepted-for-pagerduty-integration-configuration/109711 "2017-11-30T09:08:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicpav](https://avatars.discourse-cdn.com/v4/letter/v/9de053/32.png) [@vicpav](https://discuss.elastic.co/u/vicpav)\
**Post date:** [November 30, 2017, 9:08am UTC](https://discuss.elastic.co/t/contexts-is-not-accepted-for-pagerduty-integration-configuration/109711/1 "2017-11-30T09:08:35Z")

</div>

We are using **Elastic/Kibana 5.6.3** and I am configuring a watcher with PagerDuty action which is configured like that:

```
    "notify-pagerduty": {
         "throttle_period_in_millis": 1800000,
            "pagerduty": {
               "description": "Service has reported error {{ctx.payload.hits.total}} times during last 30 mins",
               "attach_payload": true,
               "account": "pagerduty_v2",
               "context": [
                  {
                     "type": "link",
                     "href": "https://link.to.kibana.filter",
                    "text": "View the incident in Kibana"
                  }
               ]
            }
         }

```

which is in line with the example provided in [X-Pack: PagerDuty Action](https://www.elastic.co/guide/en/x-pack/5.6/actions-pagerduty.html#pagerduty-event-trigger-incident-attributes). The content of the "context" field is getting ignored by PagerDuty. Their documentation claims that the name of that array field must be "contexts" (plural), see [PagerDuty API v2: Send an event](https://v2.developer.pagerduty.com/docs/trigger-events). That is the case for both API v1 and API v2. When I try renaming the field into "contexts" in the watcher configuration, I get an error message "Watcher: [parse\_exception] could not parse pager duty event template. unexpected field [contexts]".

Please correct your parser and user documentation.

---

<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:** [November 30, 2017, 4:42pm UTC](https://discuss.elastic.co/t/contexts-is-not-accepted-for-pagerduty-integration-configuration/109711/2 "2017-11-30T16:42:01Z")

</div>

Hey,

this indeed looks like a bug on the alerting side of things. I am investigating. Thank you so much for the report!

--Alex

---

<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:** [November 30, 2017, 11:03pm UTC](https://discuss.elastic.co/t/contexts-is-not-accepted-for-pagerduty-integration-configuration/109711/3 "2017-11-30T23:03:14Z")

</div>

Confirmed, that this is a bug in the pagerduty action. I am working on a fix and trying to get it in as soon as possible!

---

<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:** [December 28, 2017, 11:03pm UTC](https://discuss.elastic.co/t/contexts-is-not-accepted-for-pagerduty-integration-configuration/109711/4 "2017-12-28T23:03:32Z")

</div>

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