Request a review, go to Jira to move a ticket. Request changes to a PR, go to Jira to move a ticket. Approve a PR, go to Jira to move a ticket.
Did you remember to move the ticket??
Argh!! Why do I have to update this status in two places? Github PRs already have our "source of truth" on PR status, the Jira board should merely reflect that status.
This repo is a proof-of-concept for moving tickets (changing ticket status) in Jira based on changes in a github pull request review status.
- Request a review on Github
👉Jira transition ticket to "Review requested"
- Request revisions on Github
👉Jira transition ticket to "Todo"
- Approve PR on Github
👉Jira transition ticket to "Approved"
- Merge PR on Github
👉Jira transition ticket to "Done"
This project was designed to be a deployed as a microservice to Now.sh. From a high level, it works as follows:
- User changes PR status on Github (or does any number of other actions that trigger webhooks)
- Github sends a "webhook" request to the microservice on Now.sh (this application)
- This application...
- Checks if the webhook event is one of the supported event types
- If yes, picks the appropriate new Jira status
- Sends a request to Jira to transition the ticket (identified by branch name) to the new status
- Jira recieves the request & transitions the ticket
I made this proof of concept in one day so I cut some corners.
- Jira statuses are not universal, which means a deployment of this service is tied to a particular Jira workflow. Because Jira you to define your own workflow with your own status, your "Done" status might have "id=72" wheras my "Done" status might have "id=13"
- Did not set up any fancy auth for this, just created a Jira user & used normal password based auth
- Tickets are identified by branch name, not by searching commit messages for ticket numbers or other more robust techniques.
Didn't existing integrations already allow you to transition Jira tickets based on a PR being opened or closed?
Yes, but not based on review status changes within an open PR (review requested, changes requested, etc).