slack-plugin: slackUserIdFromEmail() Doesn't Work
Version report
Jenkins 2.277.3 Slack Notification Plugin 2.48
Issue
Hi,
I got the same issue reported here https://github.com/jenkinsci/slack-plugin/issues/763, the func return null and no errors or debug informations are available.
Scopes
Here the scopes for my slack app. chat:write files:write users:read users:read.email
Token
Config as Code
slackNotifier:
botUser: true
room: "xxx-notifications"
sendAs: "Jenkins"
sendAsText: false
slackUserIdResolver: "email"
teamDomain: "xxx"
tokenCredentialId: "slack-token"
thanks for your help. Below my code:
script {
def lastCommiterEmail = sh(returnStdout: true, script: 'git log --format="%ae" | head -1').trim()
def slackUserId = slackUserIdFromEmail("${lastCommiterEmail}")
slackSend(botUser: true, tokenCredentialId: 'slack-token', color: "good", message: "<@${slackUserId} test message")
}
Result:

Reproduction steps
I tested directly with my slack email in the slackUserIdFromEmail function but got the same result.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 2
- Comments: 16 (5 by maintainers)
We experience similar issue as posted above with the more recent versions as well:
2.440.2684.v833089650554Enabled additional logging as described here but in the resulting log there are no details about the api calls being made by slack plugin to slack and their results. It only posts log messages like the one below:
Any guidance on how to troubleshoot it further?
We ran into this same issue. We’re not able to resolve Slack userIds from email.
Slack email User ID Resolveris checkedusers:readandusers:read.emailI’ve tried with a simple snippet like this one
but I get nothing, see image below.
If I use the Slack userId directly it does work i.e.
then it does work. Any hint? In master node’s
/var/log/jenkins/jenkins.logfile I can only see this warning, nothing more usefulPlease provide more information, i.e. scopes, what resolution strategy you have configured in your global config?