Problem
Users can @mention people in nf-slack messages using Slack's native <@U1234567890> syntax with internal user IDs, and this works correctly. However, most users don't know Slack user IDs off the top of their head.
Writing <@Jane> (by display name) does not work — Slack only resolves mentions by internal user ID, so the text is rendered literally rather than as a clickable mention that notifies the person.
slack {
onStart {
// ❌ Does NOT work — display name is not resolved by Slack
message = [text: ':wave: Hi <@Jane>!']
// ✅ Works — but requires knowing the internal user ID
message = [text: ':wave: Hi <@U1234567890>!']
}
}
Proposed Solution
The plugin should resolve display names to Slack user IDs before sending the message. When the plugin encounters <@DisplayName> in message text, it should:
- Call the Slack
users.list or users.lookupByEmail API to find the matching user
- Replace
<@DisplayName> with <@U1234567890> (the resolved user ID)
- Send the message with the corrected mention syntax
Similarly for team/group mentions, resolve <!subteam^TeamName> to <!subteam^S1234567890>.
Matching strategy
Display names in Slack are not guaranteed unique, so the plugin should match against multiple fields in priority order:
- Username (
name field) — e.g. jane.doe
- Display name (
profile.display_name) — e.g. Jane
- Real name (
profile.real_name) — e.g. Jane Doe
If multiple users match, the plugin should warn and skip resolution (rather than guessing wrong).
Considerations
- Bot token scope: Requires the
users:read OAuth scope to call users.list.
- Webhook limitation: This feature would only work with bot token mode, not incoming webhooks (which can't call
users.list). Should fail gracefully or warn if using webhook mode.
- Performance: User list could be cached for the lifetime of the pipeline run to avoid repeated API calls.
- Ambiguity handling: If a display name matches multiple users, log a warning with the matches and leave the mention unresolved rather than mentioning the wrong person.
Problem
Users can @mention people in nf-slack messages using Slack's native
<@U1234567890>syntax with internal user IDs, and this works correctly. However, most users don't know Slack user IDs off the top of their head.Writing
<@Jane>(by display name) does not work — Slack only resolves mentions by internal user ID, so the text is rendered literally rather than as a clickable mention that notifies the person.slack { onStart { // ❌ Does NOT work — display name is not resolved by Slack message = [text: ':wave: Hi <@Jane>!'] // ✅ Works — but requires knowing the internal user ID message = [text: ':wave: Hi <@U1234567890>!'] } }Proposed Solution
The plugin should resolve display names to Slack user IDs before sending the message. When the plugin encounters
<@DisplayName>in message text, it should:users.listorusers.lookupByEmailAPI to find the matching user<@DisplayName>with<@U1234567890>(the resolved user ID)Similarly for team/group mentions, resolve
<!subteam^TeamName>to<!subteam^S1234567890>.Matching strategy
Display names in Slack are not guaranteed unique, so the plugin should match against multiple fields in priority order:
namefield) — e.g.jane.doeprofile.display_name) — e.g.Janeprofile.real_name) — e.g.Jane DoeIf multiple users match, the plugin should warn and skip resolution (rather than guessing wrong).
Considerations
users:readOAuth scope to callusers.list.users.list). Should fail gracefully or warn if using webhook mode.