Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incidents reassigned to HUBOT_PAGERDUTY_FROM_EMAIL #125

Closed
xofer opened this issue Jan 2, 2019 · 8 comments
Closed

Incidents reassigned to HUBOT_PAGERDUTY_FROM_EMAIL #125

xofer opened this issue Jan 2, 2019 · 8 comments

Comments

@xofer
Copy link

xofer commented Jan 2, 2019

I may be confused about how this should work.

When I am on call, new incidents are assigned to me, naturally. But when I misty pager ack, they are reassigned to the user with HUBOT_PAGERDUTY_FROM_EMAIL. See below (our hubot is called misty):

screenshot_20190102_141752

According to the v1 to v2 migration docs, requester should be specified in the From header. It seems to me that this should be set to the user who's issuing the command (i.e. whatever I set with misty pager me as ...).

However, it's always set to the same value (HUBOT_PAGERDUTY_FROM_EMAIL). This poor guy gets reassigned every ticket.

https://github.com/hubot-scripts/hubot-pager-me/blob/414608b3e198b5dacaf5046ae1a9d25692646b57/src/pagerduty.coffee#L15-L19

Am I missing something here?

@stephenyeargin
Copy link
Member

@biggless did the work in #111 to bring this over, so there may have been some trade-offs. I don't personally have an account anymore to test with. But I would expect as a user that the From header simply says who opened the incident, not who it should be auto-assigned to. Perhaps there may be a rule/schedule on the service that is doing that?

@xofer
Copy link
Author

xofer commented Jan 2, 2019

Based on experience and what's in the docs (linked above and quoted below), PD API v2 will reassign incidents to the user specified in the From header.

In API v1, several endpoints provided a requester_id parameter, used to indicate what user the API client was acting on behalf of. This enabled an API client to acknowledge an incident on behalf of a user, invite a user on another user's behalf, etc.

In API v2, this functionality is available using the HTTP From: header. Set this header with the email address of the user to act on behalf of.

@steve-stonehouse
Copy link

I too am having this issue after upgrading to the v2 API. Reading the docs, the From header needs to be the user interacting with the incident not a static one. It's a pretty big problem and we are unable to use this until it is resolved.

@biggless
Copy link
Contributor

There is possible problem when Slack email doesn't match PagerDuty email. Is it ok in such cases to fallback to static email from config?

@steve-stonehouse
Copy link

IMO it would be better for a message to be returned to the user saying that the email doesn't match. The API returns a 400 with a body of {"error":{"message":"Requester User Not Found","code":1008}} so should be possible.

@stephenyeargin
Copy link
Member

@xofer @steve-stonehouse @biggless So is there a chance that #130 might address this?

@nobert
Copy link
Contributor

nobert commented Jul 1, 2019

I can confirm that #130 fixed this problem for us. (I forked this repo and merged a duplicate of #130 to my fork, then included my branch in package.json. I believe including goodeggs/hubot-pager-me#fix-trigger-escalation-policy will do the same.

Note that we had two separate problems: one was an incorrectly set HUBOT_PAGERDUTY_FROM_EMAIL, and the second was fixed by #130. They both resulted in the same error from PagerDuty (1008).

@stephenyeargin stephenyeargin unpinned this issue Jul 4, 2019
@stephenyeargin
Copy link
Member

Fix released in v3.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants