Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket and Slack Integration

Beratcan Güreş
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2023

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!

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2023

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

Beratcan Güreş
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 15, 2023

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.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 15, 2023

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events