Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Slack Notification on PR create

grandewojtek
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!
November 22, 2021

Hi guys,
I have more than one team working in one repo and would like to set up slack notification on the channel of each team if PR is created. For that I have tried to use glob pattern but with no success. Let's say my team on Jira is called ABC so allowed branch names are:
`feature/ABC-123/some-feature`
`bugfix/ABC-123/some-bugfix`
`hotfix/ABC-123/some-hotfix`
I have tried to use various patterns but when PR from one of mentioned branchech was created no notification was sent.
I have tried:
'*ABC*`
`**ABC**`
Is there any way to set a notification trigger for all branches with ABC in the name?

1 answer

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 25, 2021

Hi, @grandewojtek

Thank you for reaching out to Atlassian Community!

I've reviewed your situation, and I understand that branch patterns have been set up for Slack notifications, however, you're not receiving notifications for pull requests creation with the pattern '*ABC*'

I have tested the steps in one of my own repositories and observed the same behavior, I am not receiving notifications when creating a pull request on the branch with the pattern (*ABC*). However, if I add the pattern "*/ABC*" it works for me.

But before you change this, I would like to give you some context around these notifications. In order to receive a notification when creating a Pull Request, you will need to create a pull request with the branch with the pattern as the target branch.

For example:

Let's say we create a pull request in which the source branch is feature and the target branch is feature/ABC-123. This will trigger a Slack notification.

  • Source branch feature -> target branch feature/ABC-123

    • Notification sent indicating a PR has been created

If I use the opposite pull request, in which we have the source branch as feature/ABC-123 and the target branch as feature, this will not trigger a Slack notification.

  • Source branch feature/ABC-123 -> target branch feature

    • No notification sent indicating a PR has been created

Let me explain why notifications are sent when the branch with patterns is set as the target branch. In a typical workflow, collaborators want to know what changes will affect a target branch. A pull request has changes from a source branch that will be merged with a target branch, so the team wants a notification when changes are coming to the target branch. 

I hope this helps, but do let me know if you have any questions. 

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events