Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at  Stonebranch Integration Hub - Terms of Use.

Overview

This Universal Task sends job status notifications to a Slack channel. It also enables users to send interactive messages in Slack for Universal Controller manual task approvals.

Version Information


Template NameVersion

SLACK-NOTIFY

1.2.0


Software Requirements

This integration requires a Universal Agent and a Python runtime to execute the Universal Task against a Slack account with an Incoming webbook enabled for a job notification. Also, in order to cater the approval functionality from Slack for a manual task type in Universal Controller, you will need to have an Interactivity enabled in Slack with the request URL which will be used to send the HTTP POST request for interactive messages by Slack.

Software Requirements for Universal Template and Universal Task

This integration requires a Universal Agent and a Python runtime to execute the Universal Task against.

Software Requirements for Universal Agent

Either:

Software Requirements for Universal Controller

Software Requirements for the Application to be Scheduled

The task can be used against any of your Slack account or workspace that is of either free or standard or plus or enterprise grid

Technical Considerations

The request URL provided in Slack could be an endpoint either in AWS lambda or Azure Function, GCP function, or your custom API endpoint to handle the interactive message from Slack and advise Universal Controller on approval or rejection of the manual task.

Below is the sample Python code that could be invoked for the Slack interactive message handling

Steps to Activate Incoming Webbooks

The URL generated here will be used in the Universal Task for posting message to slack platform


Slack Notification Key Features

Feature

Description

Job Notification

This feature can be used to send any job notification to a slack channel; for example, a job failure, Job long-running, or Job held.

Approval Notification

Typically, Manual task types in Universal Controller are used, when there is a user manual intervention needed in a workflow task type and the Manual Task is completed successfully in Universal Controller by clicking on to the manual task command “Set Completed” traditionally.

Now this task for Slack can notify Slack channel when the manual task reaches the status: “Action Required” and the User in Slack can simply click on the approve/Reject Button in the Slack interactive message that was sent by Universal Controller and then the manual task in the workflow can either go to success if approved or wait in the same status if rejected


Import Universal Template

To use the Universal Template, you first must perform the following steps.

  1. This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.

  2. To import the Universal Template into your Controller, follow these instructions.

  3. When the files have been imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list.

Configure Slack Notification Universal Task

For the new Universal Task type, create a new task, and enter the task-specific details that were created in the Universal Template.

Field Descriptions for Slack Notification Universal Task

Field

Description

Slack Function

Approval Notification  (ideal to associate with manual tasks)

Job Name

Name of the job :${ops_task_name}

Job Status

Status of the job:${ops_status}

Slack Incoming Webhook

Incoming webhook URL for your Slack account

Execution User

Execution User of the Manual Task:${ops_execution_user}

Job type

Task type of task instance: ${ops_task_type}

MessageLarge text to pass any message from UAC task execution or any custom info to Slack notifications

Examples of Slack Notification Universal Tasks

Send a Job Status Notification to slack (Task defintion)


Send a Job Status Notification to Slack (Task Instance)

Calling a Slack Job Status Notification through Action → System Operations and Launch Task

(Also this could be made generic for a group of jobs or all jobs by calling the Slack notification job from the Task monitor job.)

Slack Notifications for UAC Job Status

Approval Notification defined in Manual Task Actions ==>System Operations

Send an Approval Notification to Slack

Approval Message in Slack


Document References

This document references the following documents:

Name

Description

Universal Templates

User documentation for creating Universal Templates in the Universal Controller user interface.

Universal Tasks

User documentation for creating Universal Tasks in the Universal Controller user interface.

Changelog

ut-slack-notifications-1.2.0 (2023-04-24)

Enhancements