Advanced ServiceNow Teams Integration Playbook

Browse: 🏠 · Solutions · Connectors · Methods · Tables · Content · Parsers · ASIM Parsers · ASIM Products · Logic Apps · 📊

Back to Content Index


This playbook showcases an example of triggering an incident within a targeted Teams channel and opening up a ticket within Service Now. Additionally The playbook will also list playbooks that can be initiated from teams using an adaptive card and callbacks that will take action upon certain entities identified in the incident.

Attribute Value
Type Playbook
Solution Teams
Source View on GitHub

Logic App Connectors

This playbook uses 8 Logic App connectors / built-in actions:

Connector / Action Type Connections Actions
arm Managed 1 5
azuresentinel Managed 1 0
azuresentinel_2 Managed 0 1
service-now Managed 1 4
teams Managed 1 3
virustotal Managed 1 1
http Built-in 0 1
workflow Built-in 0 1
Action parameters (URLs, paths, function IDs)

arm (Managed)

Action Method Endpoint Other
Get_playbook_callback_URL post /subscriptions/@{encodeURIComponent(outputs('split_the_resource_ID')[2])}/resourcegroups/@{encodeURIComponent(outputs('split_the_resource_ID')[4])}/providers/@{encodeURIComponent('Microsoft.Logic')}/@{encodeURIComponent('workflows/',outputs('split_the_resource_ID')[8])}/@{encodeURIComponent('triggers/',body('Get_resource_trigger_name')?['value'][0]['name'],'/listCallbackUrl')}
Get_resource_trigger_name get /subscriptions/@{encodeURIComponent(outputs('split_the_resource_ID')[2])}/resourcegroups/@{encodeURIComponent(outputs('split_the_resource_ID')[4])}/providers/@{encodeURIComponent('Microsoft.Logic')}/@{encodeURIComponent('workflows/',outputs('split_the_resource_ID')[8],'/triggers')}
Read_a_resource get /subscriptions/@{encodeURIComponent(outputs('split_the_resource_ID')[2])}/resourcegroups/@{encodeURIComponent(outputs('split_the_resource_ID')[4])}/providers/@{encodeURIComponent('Microsoft.Logic')}/@{encodeURIComponent('workflows/',outputs('split_the_resource_ID')[8])}
List_resources_by_subscription get /subscriptions/@{encodeURIComponent(item()?['subscriptionId'])}/resources
List_subscriptions get /subscriptions

azuresentinel_2 (Managed)

Action Method Endpoint Other
Azure_Sentinel_-_Add_comment_to_related_Incident post /Incidents/Comment

service-now (Managed)

Action Method Endpoint Other
ServiceNow_-_Create_Record_for_Incident post /api/now/v2/table/@{encodeURIComponent('incident')}
ServiceNow_-_Add_additional_comments_in_ServiceNow_Ticket put /api/now/v2/table/@{encodeURIComponent('incident')}/@{encodeURIComponent(variables('ServiceNowSystemID'))}
ServiceNow_-_Query_for_Sentinel_Incident_Number get /api/now/v2/table/@{encodeURIComponent('incident')}
ServiceNow_-_Update_Record_with_Response_from_User put /api/now/v2/table/@{encodeURIComponent('incident')}/@{encodeURIComponent(variables('ServiceNowSystemID'))}

teams (Managed)

Action Method Endpoint Other
Teams_-_Reply_to_Alert_Thread post /v2/beta/teams/@{encodeURIComponent(parameters('TeamsGroupId'))}/channels/@{encodeURIComponent(parameters('AlertChannelId'))}/messages/@{encodeURIComponent(body('Post_Incident_in_SOC_Alerts_Channel')?['id'])}/replies
Post_Incident_in_SOC_Alerts_Channel post /v1.0/teams/conversation/adaptivecard/poster/@{encodeURIComponent('User')}/location/@{encodeURIComponent('Channel')}
Update_Incident_Thread_from_Investigation_Response post /v2/beta/teams/@{encodeURIComponent(parameters('TeamsGroupId'))}/channels/@{encodeURIComponent(parameters('AlertChannelId'))}/messages/@{encodeURIComponent(body('Post_Incident_in_SOC_Alerts_Channel')?['id'])}/replies

virustotal (Managed)

Action Method Endpoint Other
Get_an_IP_report get /api/v3/ip_addresses/@{encodeURIComponent(items('For_each')?['properties']?['Address'])}

http (Built-in)

Action Method Endpoint Other
Call_the_playbook_and_pass_alert_to_playbook POST @{body('Find_playbook_based_on_playbook_name_provided')[0]?['callbackUrl']}

workflow (Built-in)

Action Method Endpoint Other
LogicApp_-_Get_tagged_playbooks workflowId=[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Logic/workflows/',parameters('PlaybookName'),'-fn-getListOfTaggedPlaybooks')]
triggerName=manual

Additional Documentation

📄 Source: Advanced-ServiceNow-Teams-Integration/readme.md

Advanced - ServiceNow & Teams Integration

Author: Jing Nghik

Alt Text

This arm template will deploy multiple logic app playbooks and api connectors.

Updates

Video Walkthrough IMAGE ALT TEXT HERE

Requirements

In order to fully utilize this playbook. There are a number of pre-configuration steps required before deploying the Logic App.

You will need the following:

Workflow

  1. Based on the rules, Microsoft Sentinel triggers an incident or alert.
  2. This runs a linked playbook that first will check to determine if an existing serviceNow ticket already exists with the same incident ID (to prevent duplicate tickets)
  3. The ticket is opened in serviceNow and a Teams message is created in the Alerts channel with alert/incident details.
  4. A corresponding investigation response message is sent with a list of available playbooks that can be run from teams.
  5. Based on selected playbooks submitted, the playbooks are ran ad-hoc by routing the alert body to the selected playbook.
  6. If the executed playbook returns a response, that message is updated in the related serviceNow ticket, commented in the Microsoft Sentinel Incident, and also added added as a reply to the Initial Teams Alert message.

Setup Steps

  1. Click Deploy to Azure and fill in parameters
  2. Populate the Teams Group and Channel IDs to ensure it messages are generated in the right channel.
  3. Search for API connectors and find the deployment prefix and fix any connectors by authorizing the connection. Alt Text
  4. Manually trigger an Microsoft Sentinel alert to test.

Deploy the ARM template

Thanks!

Thank you to the following people for contributing to my efforts in building this playbook!

Todo list


Browse: 🏠 · Solutions · Connectors · Methods · Tables · Content · Parsers · ASIM Parsers · ASIM Products · Logic Apps · 📊

Back to Playbooks · Back to Teams