Configure Slack modals in ServiceNow instance

Create modal and specify fields that should be displayed in your Slack modal. Modal UI can be generated in two ways; automatically using a ServiceNow table and manually using a custom View Payload.

Before you begin

Role required: admin.

About this task

For example, if you want to create incident using modal in Slack, the Create Incident modal requires Priority, Category, and Short Description fields.
Note: Modals can be triggered from these interactive Slack components:
  • Command,
  • Block action,
  • Global shortcut, and
  • Message shortcut.

Procedure

  1. To create a modal with UI that is automatically generated using a ServiceNow table:
    1. Navigate to Slack > Slack Modal Configuration.
    2. Click New.
    3. On the Slack Modal Configuration form, fill these values.
    4. Right-click the form header and click Save.
      The Create Incident modal is created in Slack.
      Slack modal.
  2. To create a modal with UI that is manually generated using a custom View Payload:
    1. Navigate to Slack > Slack Modal Configuration.
    2. Click New.
    3. On the Slack Modal Configuration form, fill these values.
    4. Right-click the form header and click Save.
      The Create Incident modal is created in Slack.
  3. Specify conditions to define when the modals should be displayed:
    1. Navigate to Slack > Inbound Decisions For Modals .
    2. On the Decision form, fill these values.
      Note:
      • Copy and record the value of sys_id. You can use this sys_id as the unique value in Callback ID while configuring the shortcut or message shortcut in your Slack app.
        sys_id of the modal's inbound policy record.
        Note: Two system properties are added to handle the inbound communications:
        Table 4. System properties
        Category Property name Description Example
        Slash commands sn_slack_ah_v2.command.special_characters The characters encoded using the encodeURIComponent method are handled internally. To replace any additional special characters used in Slash commands in the Slack application with their encoded URI characters, add the characters in a JSON format.

        {

        "~" : "%7E",

        "\(" : "%28",

        }

        Interactivity & Shortcuts: sn_slack_ah_v2.interactivity.special_characters

        The characters encoded using encodeURIComponent method and the following characters are handled internally: !, ', (, ), *, ~

        Fill in the property to replace any additional special characters used in Slack Interactivity & Shortcuts in the Slack application with their Encoded URI characters in a JSON format.

        {

        "~" : "%7E",

        "\(" : "%28",

        }

        To display modals for the required shortcut, in Condition, provide the sys_id of the modal's inbound policy record.
        Display modals for Slack shortcuts.
      • To display modals for the required Slack commands, in Condition, provide the required command for which the modal should be displayed.
        Display modals for Slack commands.
      • To display modals for the required Slack block action, in Condition, provide the required action ID of the required block action for which the modal should be displayed.
        Display modals for Slack block actions.
    3. Click Submit.
      When events in Slack meet conditions specified in the policy, the associated modal is displayed.
      Note: These inbound decisions are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.
  4. Specify tasks to be performed when user provides values in the modals by creating an inbound policy:
    1. Navigate to Slack > Inbound Decisions.
    2. Click New.
    3. On the Decision form, fill these values.
    4. Click Submit.
      When Slack user provides inputs in the modal, the associated subflow is triggered after validating the inputs. Depending on the automations configured in your subflow, tasks are performed.