I'm currently trying to connect bitbucket pull requests to the Slack workspace. When I try branch pattern expressions I'm not getting any notifications on Slack. The document I use is :
https://support.atlassian.com/bitbucket-cloud/docs/integrate-bitbucket-cloud-with-slack/
I'm trying to find an expression that matches these branches :
feature/alpha/taskid
bug/alpha/taskid
epic/alpha/taskid
alpha keyword is the keyword that I want to filter.
I tried many expressions but I wasn't getting any notifications. (Connection has no problem because if I try repository-wide, I get the notifications.)
I have tried the following:
'*/alpha/**'
*/alpha/
'**/alpha/**'
I have tried them separately :
feature/alpha/*
feature/alpha/**
but I couldn't find the reason why. Can you help me please ? Thanks!
Hello @Beratcan Güreş and welcome to the Community!
Could you please try providing the pattern without using the single quotes, like in the below example :
*/alpha/**
With this syntax, I was able to successfully get the notifications on Slack for the pull requests that involved branches matching that pattern.
Let me know how it goes and if this solves the issue :)
Thank you, @Beratcan Güreş !
Patrik S
Hello @Patrik S ,
Thank you for your answer. Sadly, it didn't work. While I was trying the combinations I figured that if I use the PR's target branch, I get notifications. Should I aim for the target branch pattern or should it work for the base branch ?
What I meant is if I open a pr like this :
feature/alpha/blabla -to-> development/alpha
And if I set the notification pattern as : development/alpha
I get notification about it. But when I try the :
*/alpha/**
I won't get the notification about it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Beratcan Güreş ,
You're correct, the Slack pull request events will match against the destination branch of the pull request.
The reason why you didn't receive a notification for development/alpha when using the pattern */alpha/** is because that pattern expects a forward slash after the alpha word, which development/alpha does not have.
In this case, you could create another pattern that matches all branches that end with the alpha word :
*/alpha
This should match against development/alpha.
You can create multiple patterns in the Slack configuration to match all the scenarios of your use case.
Thank you, @Beratcan Güreş !
Patrik S
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.