With the Slack integration described here, your authorized Harness users can approve or reject Workflow steps and Pipeline stages directly from Slack. This topic outlines both Slack and Harness setup, in the following sections:
- Create Slack App
- Configure Harness API Endpoint in Slack
- Configure Harness User Notifications for Slack
- Approve Workflows via Slack
- Approve Pipelines via Slack
- Account Administrators
Create Slack App
- Name your app, assign it to a Workspace, and select Create App.
- Select Incoming Webhooks.
- Enable the Activate Incoming Webhooks slider:
- Click Add New Webhook to Workspace.
- At the Confirm your identity challenge, select the Slack channel in your organization that should receive approval notifications. (To select an appropriate channel, see Configure Harness User Notifications below.)
- Click Install (or Authorize) to confirm this setup.
Configure Harness API Endpoint in Slack
Next, configure the API endpoint from Harness for interactivity, as follows. (For details, see Slack's Making Messages Interactive documentation.)
- Select Interactive Components.
- Enable the Interactivity slider:
- Enter the Request URL, as either
https. The Request URL is independent of the approval channel that we'll configure below.
Harness SaaS users should enter a URL of the form shown above:
On-prem users will instead have a URL of the form:
- Click Save.
- Return to the Slack app's Incoming Webhooks tab.
- From the resulting app settings, copy the Webhook URL to your clipboard.
You've now configured API endpoints in both your Slack app and Harness. Now, you're ready to set up notifications for the Harness User Group, and the Slack channel, where you want to enable approvals.
Configure Harness User Notifications for Slack
Enabling Slack notifications in Harness is straightforward, but there are some important considerations:
- Select a Harness User Group that has appropriate permissions. (These permissions must include Application: execute permissions on all relevant Applications.)
- You must create a Slack channel that has the same members as the User Group.
- You must manually keep the Slack channel's membership synchronized with the User Group's membership.
- You should normally configure this as a private Slack channel.
Once you have selected the appropriate User Group and Slack channel to use:
- Open the User Group's notification settings. (See Notification Settings for User Groups.)
- In the Notification Settings dialog, specify the Slack Channel Name.
- Paste in the Slack Webhook URL you copied above in Configure Harness API Endpoint.
Approve Workflows via Slack
Once you've configured the URLs and channel notification settings above, members of the configured channel can approve (or reject) Workflow and Pipeline deployments directly from that channel.
To set up Slack approval within a Workflow:
- Within a Workflow step, select Add Command.
- In this resulting dialog, select Other > Approval:
- In this resulting Approval dialog, accept the default setting Ticketing System: Harness UI.
- In the User Groups drop-down, select the group you enabled above in Configure Harness User Notifications:
- When your dialog looks something like this, you're ready to click SUBMIT:
To see how approval of this step works in practice, see Slack-based Approvals.
Approve Pipelines via Slack
To set up Slack approval within a Workflow Pipeline:
- Add a stage to the Pipeline:
- In the resulting dialog, accept the default Harness UI ticketing system:
- Select the User Group you've configured for approvals:
- Set a reasonable Timeout and (optionally) name the stage:
- Click SUBMIT to save the stage.
To see how approval of this stage works in practice, see Slack-based Approvals.