jenkinsci / jenkinsci/slack-plugin

Add support for `as_user` boolean parameter for legacy bots

Open
#690 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
672
Forks
396
Avg merge
2d 23h
Merged PRs (30d)
5

Description

### Your checklist for this issue

- [ x ] Jenkins version 2.222.3

- [ x ] Plugin version 2.40

- [ x ] OS Ubuntu

### Description
The quickest way to post messages to Slack is to use a "Custom Integration > bot". (AKA legacy bot.)

One can set a "username" and choose an "icon".

However, for the messages to _actually appear_ with that username and icon, one needs to 1) add the bot to the channel via "Add app" and 2) provide "as_user" parameter set to "true".

Documentation: https://api.slack.com/methods/chat.postMessage

slackSend method does not provide an option for "as_user" parameter.

As a result, the name and the icon of the app aren't used as configured in Slack.

Contributor guide

Open the contributing guide

Research direction

Start at the slackSend method and trace how it builds the Slack chat.postMessage request. Read the linked Slack API documentation for the legacy bot's as_user parameter, then identify the plugin's existing validation or integration tests. Done means callers can provide the boolean and Slack receives it so the configured username and icon are used.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.