Hi!
I need to send post request from Jira Data Center to private Slack channel.
Now I have the task to drop the legacy solution like custom integration "Incoming webhook", but sending to app's webhoo does not allow to send a message to the private channel, and it also prohibits to change the channel.
If I understand correctly, the only option I have is to send a post request. I have tested on the test page in the documentation https://api.slack.com/methods/chat.postMessage/test, specifying the channel id, token and text. The message came through.
However, when I try to send a request as a result of a rule in Jira or via Postman, nothing comes to Slack.
Is it possible that I am doing something wrong? Below is a screenshot of my rule settings where the status in the logs is success, but the request doesn't get through, apparently due to improper composing in the rule.
In Postman, you're posting a URL-encoded body, whereas in Jira Automation, you're posting a JSON body. So, if I were you, I would try to get a successful request in Postman using JSON body with your bot token in the Authorization header (and remove the token value from the JSON body). Be sure to check out this Slack docs section.
Once you're able to do that in Postman, I would then try recreating the request in Jira Automation.
Thanks a lot for your help!
After trying different ways, I managed to get the rule to work. I'm attaching a screenshot of the correct usage here in case anyone encounters something similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello there. According to Slack's documentation, you need to add the authorization token (your bot token) in the header. For instance, in your first attachment, you see:
Authorization: Bearer xoxb-xxxxx
Try adding that to your request in Postman first, and see how it goes. In fact, in your shoes, I would only spend time getting my Postman request to work properly before trying to move onto Jira Automation.
And.. if the solution is as simple as my suggestion above, for Automation, you'd simply add another header, one for "Authorization", that is.
Good luck! And welcome to the Community!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Neil Mansilla !
Thanks for the answer.
In the end I was finally able to send a request from Postman. It looks like this:
Any idea how to convert this to send the same thing from Jira? I've tried a bunch of options and don't understand what I'm doing wrong or how to correctly specify all the parameters. Also i've tried using Authorization header with value "Bearer xoxb-xxx..." but still nothing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.