Setting of notifications in Slack

Slack has an app, сwith which you can customize your notification. And you don't need a technician to do this, just go through a few steps to configure:


1. Follow the link and click the «Add to Slack» button (if you are not logged into the application, enter by pressing the button «Sign In to install»).



2. Select the channel to which messages will be sent.



3. Click «Add Incoming WebHooks integration».



4. On the next page, study the brief instructions for configuring the integration (if necessary) and fill in the settings:

  • Channel – select the channel to which notifications will be sent;


  • URL-address – address for forwarding webhooks (for notifications);
  • Description — add an additional description that will be displayed in the list of your integrations (optional);
  • Name — enter the name from which webhooks will be sent to the channel;
  • Icon — customize the icon or emoji that will be used for messages;
  • See the preview of the post, how it will look in the preview channel.

Save settings via button «Save settings».

5. In Usedesk, open the «Automation» → «Rules» section and add a rule for sending a POST request.



An array must be inserted into the POST line of the request on the right, where URL is the address for forwarding webhooks (item 4). Also, check out our API documentation.

Done!

{
    "url": "https://hooks.slack.com/services/T02D73XAM/B017VGNQBSB/k7WQELW6nmFvv",
     "data": {"attachments":[{
"fallback":"{{ticket_subject}} тикет#{{ticket_id}}",
"pretext":"{{ticket_subject}} тикет#{{ticket_id}}",
"color":"#4CA9E4",
"fields":[
{"title":"Sender","value":"{{client_email}}","short":true},
{"title":"Group","value":"{{ticket_field__3482}}","short":true},
{"title":"Agent","value":"{{user_name}}","short":true},
{"title":"Assessment","value":"{{nps_rating}}","short":false},
{"title":"Comment","value":"{{nps_comment}}","short":false}
]}]}

}