Setting up the connection to Slack
How to connect your SonarQube Server instance to your Slack workspace.
With the SonarQube Server integration with Slack, users can receive real-time notifications on analysis results directly in Slack. For more information, see About SonarQube Server integration with Slack.
To set up this feature, a SonarQube Server administrator must first connect your SonarQube Server instance to your Slack workspace. Once this initial setup is complete, users can subscribe to SonarQube Server notifications directly within their Slack account: see Subscribing to Slack notifications.
Connecting your SonarQube instance to your Slack workspace
You must be an administrator of your SonarQube Server instance and of your Slack workspace.
Step 1: Create the SonarQube Server app for Slack for your SonarQube instance
Create the app
In your SonarQube Server instance, go to Administration > Configuration > General Settings > Integrations.

In the Slack section, select Start setup. You are redirected to Slack.

Select your Slack workspace and select Next. The app’s Basic Information page opens.
Set up the app
In the left navigation bar of the app, select Features > Event Subscriptions.

In Enable Events > Request URL, select Retry. The Request URL should now be verified.

In the bottom right corner of the page, select Save Changes.
Copy-paste the app parameters to SonarQube Server
In the left navigation bar of the app, select Settings > Basic Information. You can see the Client ID, Client Secret, and Signing Secret parameters in the App Credentials section.

Copy-paste each of these parameters from Slack to your Slack configuration in SonarQube Server.

Select Save configuration. Your SonarQube Server app for Slack is ready to be installed.
Step 2: Install the app on your Slack workspace
Once you have successfully created your SonarQube Server app for Slack, you can install it in your Slack workspace:
In your SonarQube Server instance, go to Administration > Configuration > General Settings > Integrations.

Select the Install SonarQube for Slack button. You’re redirected to Slack.

Select your workspace.
Select Allow. The app is installed in your workspace. Workspace users can now subscribe to Slack notifications on SonarQube events.
Connecting your SonarQube instance to multiple workspaces
You can connect your SonarQube Server instance to multiple Slack workspaces. Once you have created and installed the SonarQube Server App for Slack in your first workspace as explained above in Setting up the connection to Slack, you must change the settings of your SonarQube Server App for Slack to enable multiple workspaces. Once this is done, you can install the app in other workspaces as described in Step 2: Install the app on your Slack workspace above.
To enable multiple workspaces in your app:
Open the SonarQube Server App in the Slack workspace in which you created it.
In the left navigation bar, select Settings > Manage Distribution and navigate to the bottom of the page.
In Share Your App with Other Workspaces > Remove hard Coded Information, select the I’ve reviewed and removed any hard-coded information option.

Select the Activate Public Distribution button.
Connecting a workspace to multiple SonarQube instances
You can connect the same Slack workspace to several SonarQube Server instances. To do so, you must configure different slash commands for each SonarQube Server app for Slack to differentiate them. The slash command must have the following format:
/sonarqube-server<identifier>
For example, if you want to connect your workspace to two instances, you may configure the slash command as follows:
For the first instance:
/sonarqube-server(default value)For the second instance:
/sonarqube-server-2
Inform your end users to use the correct Slash command when subscribing to Slack notifications for SonarQube.
To configure the slash command of your SonarQube Server app:
In your Slack workspace, open the SonarQube Server app you want to configure.
In the left navigation bar, select Features > Slash Commands.

Select the edit icon and change the slash command.
Modifying your Slack configuration
If you modify the client ID, client secret or signing secret of your SonarQube Server app for Slack, you must update the change in SonarQube Server.
To update your Slack configuration in SonarQube Server:
In your SonarQube Server instance, go to Administration > Configuration > General Settings > Integrations.

In the Slack section, in App configuration details, select the Edit button. The Slack configuration dialog opens.
Update the parameters and select the Update configuration button.
Deleting your Slack configuration
You must delete both the Slack configuration in your SonarQube Server instance and the SonarQube Server app. Deleting the Slack configuration will delete all connections and Slack-related data on SonarQube Server based on this configuration.
Proceed as follows:
In your SonarQube Server instance, go to Administration > Configuration > General Settings > Integrations.
In the Slack section, in App configuration details, select the dustbin icon.

Confirm the deletion.
Open the SonarQube Server app in the Slack workspace in which you created it and delete it.
Relates pages
Subscribing to Slack notifications About SonarQube Server integration with Slack
Last updated
Was this helpful?

