This field is only visible when Buttons is selected in
the Type field.
Enter a script to define what happens in your instance
when a user selects a button in Slack or Microsoft
Teams. Use the actions.get method to
return the name of the button selected by the user.
if (actions.get('button') == 'Approve') {
target.state = 'approved';
target.update();
}
In this example, the script conditionally executes when
the "Approve" button is selected.
Use the method
sn_notification.Messaging.send to
send information to the messaging window.
var content = new GlideRecord("messaging_content");
content.get("1bb10839572213007f004758ef94f9c4"));
sn_notification.Messaging.send(application, userId, content, target);
In this example, the script stores a Message Content
record in the content variable. It then
posts a message from that Message Content record.
|