Skip to content

Slack configuration

German Malykh edited this page Aug 17, 2022 · 11 revisions

1. Slack notification configuration

To receive Slack notifications, you need to fill in the part of the configuration file referring to Slack

Configuration template for Slack notifications:

"slack": {
    "token": "...",
    "chat": "...",
    "replyTo": ""
}
  • "token" - Bot user OAuth token
  • "chat" - Chat name
  • "replyTo" - Leave the field blank

Next, let's look at how to get this data

1.1. Token

  1. Go to https://api.slack.com/apps and click "Create New App"


2. Give name for your app and select your Workspace


3. Open your app, go to OAuth & Permissions. Grant permissions chat:write, files:write


4. Install it to your Workspace


5. Remember Bot user OAuth token

1.2. Chat

  1. Create new channel in your Workspace (This is value for "chat")


2. Go to APP profile and add it to channel


The final configuration will look like this:

  "slack": {
    "token": "xoxb-3999983300007-3888860300000-TSQbRtj9XqWeRTyPsZQ3FGD6",
    "chat": "allure_test",
    "replyTo": ""
  }

2. Adding allure-notifications.jar to your autotests project

3. Configure Jenkins (for example)

java  \
"-Dchat.id=#allure_notifications_channel" \
"-Dbot.token=xoxb-1687076169986-..." \
"-Dproject.name=${JOB_BASE_NAME}" \             <- jenkins environment var
"-Dbuild.launch.name=Some release 2.0" \
"-Dbuild.env=https://prod.your.site" \
"-Dbuild.report.link=${BUILD_URL}" \            <- jenkins environment var
"-Dlang=en" \
"-Denable.chart=true" \
"-Dallure.report.folder=./allure-report/" \
-jar allure-notifications-2.2.1.jar

4. Slack notification example