How to trigger feature branch build from JIRA issue transition in the easiest way?
Hi @moodagent,
Thank you for reaching out.
Can you please share more details about your use case and what you’re trying to achieve? Can you please also clarify what you mean by JIRA issue “transition”?
What initially comes to mind however, is triggering a build using our API. You can read more about this here: https://devcenter.bitrise.io/api/build-trigger/.
Thanks and looking forward to hearing from you,
Luna
Hi
What we are trying to achieve is automating feature branch builds, so when an app feature is code-reviewed, a build should be made for QA to test and approve it. We think a nice way to do that is when the feature JIRA issue status is changed in the project scrum/kanban board.
A JIRA issue transition is when a JIRA issue is moved from one swim lane to another, i.e. from In Progress to Done, or from Dev Review to QA. So basically this is done by setting up a webhook in JIRA, telling it to call an URL when such defined issue transition happens.
I am following your advice and now working on a small Python script that will accept the JIRA issue key as parameter and then do two thing:
- Call JIRA API to fetch the issue ID using the issue key as parameter
- Call JIRA API to fetch the BitBucket branch name, linked to that issue, using the issue ID as parameter
- Call BitRise API to trigger a feature branch build for our QA team, using the BitBucket branch name as parameter
Hope it does make sense.
Hi @moodagent,
Thank you for providing this explanation. I recommend reading through https://api-docs.bitrise.io/#/builds/build-trigger. As long as you have a Git tag, Git commit hash, a branch, or a workflow ID, you can trigger a new build using a POST /apps/{app-slug}/builds
request.
Please don’t hesitate to follow-up if you have any other questions.
Cheers,
Luna
Hi @moodagent,
Please let us know if you have any other questions.
Otherwise, in 5 days I will close the topic.
Thanks,
Luna