Below you will find the details on how to create a simple Slack App that permits Slack notifications for Bitbucket App to create threads for each pull request instead of posting all messages as separated messages.

Slack Bot creation

Url to create a new Slack App:

Click on “Create New App“.

Then choose: “From scratch”

Fill in the required information:

After the application is created required permissions should be added. Go to “OAuth & Permissions”

Scroll down to “Bot Token Scopes”. Add next permissions:

Then scroll up and install the app to the workspace:

Choose the channel to post messages:

Your token is ready:

Additional useful links:

Using Bot token in Bitbucket Slack plugin

Bot token can be used in Bitbucket Slack plugin settings at any level instead of the Incoming Webhook URL.

If OAuth token is used then all messages related to the same pull request are grouped in a thread.

Which looks like this when open.