Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slacksend returns null response #776

Open
Lovee2412 opened this issue Sep 8, 2021 · 11 comments
Open

Slacksend returns null response #776

Lovee2412 opened this issue Sep 8, 2021 · 11 comments
Labels

Comments

@Lovee2412
Copy link

Jenkins and plugins versions report:
Jenkins 2.263.2
Slack plugin 2.48
slackResponse = slackSend (baseUrl : slackURL,
teamDomain:'myteam',
channel: slackChannel,
message: 'Hello, world',
iconEmoji: 'jenkins',
botUser: 'false',
token: slackToken,
username: 'Jenkins')
sh"""
echo ${slackResponse}
echo ${slackResponse.channelId} // channelid is null
echo ${slackResponse.ts} // ts is also null
"""
jenkis logs

  • echo jenkins.plugins.slack.workflow.SlackResponse@1f6401de
    jenkins.plugins.slack.workflow.SlackResponse@1f6401de
  • echo null
    null
  • echo null
    null
@Lovee2412 Lovee2412 added the bug label Sep 8, 2021
@timja
Copy link
Member

timja commented Sep 8, 2021

did you setup a custom slack app?

@Lovee2412
Copy link
Author

Lovee2412 commented Sep 8, 2021 via email

@timja
Copy link
Member

timja commented Sep 8, 2021

@Lovee2412
Copy link
Author

Hi Timja
i created custom app as per above doc and using that token but is failing
with below error
Slack Send Pipeline step running, values are - baseUrl: SlackURL, teamDomain:myDomain, channel: #qe_result_test, color:
, botUser: true, tokenCredentialId: Slack Token, notifyCommitters: false, iconEmoji: jenkins, username: Jenkins, timestamp:
ERROR: Slack notification failed with exception: ok
ERROR: Slack notification failed. See Jenkins logs for details.

Response is null

@Lovee2412
Copy link
Author

slackResponse = slackSend (baseUrl : slackURL,
teamDomain:'myDomain',
channel: slackChannel,
message: 'Hello, world',
iconEmoji: 'jenkins',
botUser: 'true',
token: slackToken,
username: 'Jenkins')
//timestamp:ts.toString())
sh"""
echo ${slackResponse}
echo ${slackResponse.ts}
echo ${slackResponse.channelId}
"""

@timja
Copy link
Member

timja commented Sep 8, 2021

Anything in the logs? Have you invited the app to the channel?

@Lovee2412
Copy link
Author

Yes invited
Is mandate to select Custom slack app bot user?
If i select this it will be problematic for others channel notification

@timja
Copy link
Member

timja commented Sep 8, 2021

there's more features in the bot users so it is recommended.

The 'legacy' one has not been updated by Slack in a long time

@Lovee2412
Copy link
Author

if it is set then it will impact the flow which use legacy app?

@timja
Copy link
Member

timja commented Sep 8, 2021

not if you leave botUser off globally and only enable it in the jobs you need it.

@Lovee2412
Copy link
Author

how to set globally off for botUser and enable in job level
thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants