Best answer

Attach Slack message to a GitHub issue

  • 26 April 2024
  • 3 replies
  • 27 views

Userlevel 1

Is it possible to attach a Slack message, or the contents of the message, to a GitHub issue?

In my workflow, a GitHub issue gets created when a Slack message matching a certain criteria is received. I’d like to be able to better map the GitHub issue to the Slack message.

icon

Best answer by SamB 1 May 2024, 15:41

View original

3 replies

Userlevel 7
Badge +11

Hi @gmoney, thanks for joining the Community here! 🎉 

The Slack triggers should provide the text for the Slack message that you can then select in the GitHub action. For example the New Message Posted to Channel trigger supplies the message contents in a field called Text. So if you map that Text field to the Body field on a Create Issue (GitHub) action then the contents of the Slack message will be added to the issue that’s created.

For example:

4d49e2062aff4af29383223dbd5f260b.png

Not sure what criteria you’re wanting to use for determining which Slack messages should be passed to GitHub but, if you’ve not done so already, you may want to look at adding a filter to the Zap to help check for certain conditions. You can learn more about using filters in our Add conditions to Zaps with filters and Filter and path rules in Zaps guides.

Hope that helps to get you pointed in the right direction. If you run into any issues on that or have further questions do let us know!

Userlevel 1

Thank you @SamB ! Do you know if there’s a way to attach the actual file to the GitHub issue the way it gets attached to the Slack message like in the first pic instead of adding the link to it?

 

Userlevel 7
Badge +11

Thanks for getting back to me here @gmoney.

Hmm, it doesn’t look like there’s any sort of attachment field available. So I’d recommend reaching out to our Support team to ask that they open up a new feature request on your behalf for the ability to attach files to new issues when creating them. You can do that here: https://zapier.com/app/get-help.

As a workaround, it looks like GitHub supports basic authentication so you could potentially use a Webhooks action to create the issue and add the attachment that way (assuming their API supports the upload of files to issues)? It’s a bit advanced as you’d need to reference GitHub’s API documentation to set up the request and would require a paid plan. But if you’d like to explore that we have a general guide on how to set up Webhooks actions to help get you started: Send webhooks in Zaps

Hope that helps. If you get stuck at all on that do let us know, happy to assist further! 🙂

Reply