Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×I am setting up Jira Automation to create new bitbucket branches when transitioning a ticket to InProgress.
However this will cause problems if a branch has already been created,
Additionally in some cases a developer may need to create a branch based on a different base branch, instead of Dev or Master.
For this a developer could create the branch in advanced before transitioning.
We need to determine if a bitbucket branch already exist for a ticket, before automatically creating a new one on transition.
I have looked at different conditions and cannot find a way of detecting if a code branch already exists.
The closest I can find is the branch smart values listed at the top of this document: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/
However that only works when using the Branch created trigger.
Hi @owen heggen -- Welcome to the Atlassian Community!
To do that I believe you can use a web request from the rule to call the BitBucket REST API and check if exists first. Here is a how-to for calling a REST API from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
Kind regards,
Bill
Cheers mate,
I'm yet to confirm this but it looks like it will work.
Just a matter of going through the bitbucket api and finding a suitable endpoint.
Then adding a following condition component to test the response from the web request action component.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.