This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Description
Our current workflow looks like this:
- Feature in Aha!
- Send feature to GitHub as an issue
- Engineers take GitHub issues and convert to a PR (using
hub pull-request -i)
- Feature state is synced with status label so as it goes through inprog/awaiting review/merged the feature in Aha! gets updated.
The problem comes when the issue is converted to a PR - because GitHub then starts sending pull_request webhooks, Aha!'s integration drops the payload. However, a GitHub PR is a child of an issue - you can use them virtually interchangeably. The problem is caused by this line, which drops the payload if issue isn't present - in a PR it's called pull_request. Changing this line to something like action, issue, repo = payload.webhook.action, payload.webhook.issue or payload.webhook.pull_request, payload.webhook.repository should allow it to be used with both.
Currently we're working around this process by having GitHub send the webhooks to a bot, which is rewriting that one payload key to issue, and sending it on to the correct product in Aha! - but it'd be nice to not have to do this.