# Using the slack integration

**URL:** <https://community.jenkins.io/t/using-the-slack-integration/8245>\
**Category:** Ask a question\
**Created:** [June 29, 2023, 4:06pm UTC](https://community.jenkins.io/t/using-the-slack-integration/8245 "2023-06-29T16:06:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bay.gaillard](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bay.gaillard](https://community.jenkins.io/u/bay.gaillard)\
**Post date:** [June 29, 2023, 4:06pm UTC](https://community.jenkins.io/t/using-the-slack-integration/8245/1 "2023-06-29T16:06:55Z")

</div>

Greetings. I am trying to post to a slack channel when the build succeeds or fails. We have a remote jenkinsfile that defines the shared build steps for all our jobs. I am doing the following:

```auto
success {
            notifyGitHubStatus(message: "built tag ${env.CP_BUILD_ECR_IMAGE_TAG}", status: "SUCCESS")
            script {
                def serviceToBuild = builder.findService(env.CP_BUILD_SERVICE_NAME)
                if (serviceToBuild.buildConfiguration.slackChannel != null) {
                    slackSend(channel: serviceToBuild.buildConfiguration.slackChannel, message: "Build success on ${env.CP_BUILD_ECR_IMAGE_TAG} for service ${env.CP_BUILD_SERVICE_NAME}")
                }
            }

        }

```

however, I am getting the following error:

```auto
11:39:52 GMT-04:00 Slack Send Pipeline step running, values are - baseUrl: <empty>, teamDomain: mbonline-team, channel: notify-platform, color: <empty>, botUser: true, tokenCredentialId: jenkins-b2c-token, notifyCommitters: false, iconEmoji: <empty>, username: <empty>, timestamp: <empty>
11:39:52 GMT-04:00 ERROR: Slack notification failed with exception: {"ok":false,"error":"not_in_channel"}
11:39:52 GMT-04:00 ERROR: Slack notification failed. See Jenkins logs for details.

```

When I go to the channel, I try to do @jenkins but I only get coworkers whose surnames are Jenkins. The app is installed from the app directory, and I can view the config, but it won’t let me invite the bot user. Is there some way I can just let it post to every channel it wants to?

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [July 5, 2023, 8:05am UTC](https://community.jenkins.io/t/using-the-slack-integration/8245/2 "2023-07-05T08:05:47Z")

</div>

Hi @bay.gaillard and welcome to this community 👋

It looks like your bot user is not a member of the channel you want to post into.  
I think you should try to grant your bot the necessary permissions. 🤷

---

<div class="post-metadata">

**Author:** ![bay.gaillard](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bay.gaillard](https://community.jenkins.io/u/bay.gaillard)\
**Post date:** [July 18, 2023, 2:16pm UTC](https://community.jenkins.io/t/using-the-slack-integration/8245/3 "2023-07-18T14:16:14Z")

</div>

yes, but how? I tried adding the bot to the channel but I can’t. It’s not popping up when I do /invite.

---

<div class="post-metadata">

**Author:** ![bay.gaillard](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bay.gaillard](https://community.jenkins.io/u/bay.gaillard)\
**Post date:** [July 19, 2023, 5:28pm UTC](https://community.jenkins.io/t/using-the-slack-integration/8245/4 "2023-07-19T17:28:54Z")

</div>

![Screenshot 2023-07-19 at 1.27.52 PM](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/e/e40c6de211855235aff852aa285a3080d02d3244.png)  
^ the configuration, but…

---

<div class="post-metadata">

**Author:** ![bay.gaillard](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bay.gaillard](https://community.jenkins.io/u/bay.gaillard)\
**Post date:** [July 19, 2023, 5:29pm UTC](https://community.jenkins.io/t/using-the-slack-integration/8245/5 "2023-07-19T17:29:45Z")

</div>

![Screenshot 2023-07-19 at 1.29.07 PM](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/3/39efd4dbfb2dd2cb02d2bc4ce474e9f9278468ea.png)  
^ notify-platform
