ServiceNow - Basic Auth

Achieve end-to-end transformation for your IT services and infrastructure through a single cloud-based platform. ServiceNow IT Service Management (ITSM) software lets you consolidate fragmented tools and legacy systems while automating service management processes.

Integration with LogicHub

Connecting with ServiceNow

Note: From version 2.0.0 we are supporting "OAuth" authentication mechanism. Please visit here to set up OAuth.

To connect to ServiceNow following details are required:

  • Label: Connection name.
  • Reference Values: Define variables here to templatize integration connections and actions. For example, you can use https://www.{{hostname}}.com where, hostname is a variable defined in this input. For more information on how to add data, see 'Add Data' Input Type for Integrations.
  • URL: URL of the ServiceNow server.
  • Username: Username to log in with.
  • Password: Password to log in with.
  • Client ID*: Client id to log in with.
  • Client Secret*: Client secret to log in with.

📘

Note

Client ID & Client Secret are not required for ServiceNow (Basic Auth) integration.

Actions with ServiceNow

Create Incident Ticket Incident

Creates a ticket with the specified details whenever the parent table has any results.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Short Description Column Name: Column name that contains the short description of the ticket to create.
  • Advance Ticket Options Column (Optional): Column name that contains advance options in JSON format of the ticket to create.
  • Create Duplicate Ticket (Optional): Do you want to create duplicate tickets on a short description? (Default is 'No').

Output of Action:
json containing following items:

  • has_error: True/False
  • error: message/null
  • result: Ticket Id.

Update Incident Ticket

Updates a ticket with the specified details whenever the parent table has any results.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Ticket Id Column Name: Column name that contains the id of the ticket to update.
  • Short Description Column Name: Column name that contains the short description of the ticket to update.
  • Advance Ticket Options Column (Optional): Column name that contains advance options in JSON format of the ticket to update.

Output of Action:
json containing following items:

  • has_error: True/False
  • error: message/null
  • result: Ticket Id.

Get Incident Ticket

Retrieves the incident details with a given incident ID (sys_id).

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Incident Id Column Name: Column name that contains the incident ID.

Output of Action:
json containing following items:

  • has_error: True/False
  • error: message/null
  • result: Incident details.

Search Incident Tickets

Searches your ServiceNow instance for tickets with the specified details whenever the parent table has any results.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Short Description Column Name: Column name that contains the short description of the ticket to update.
  • Jinja2 Template to filter results (Optional): Template to filter results. e.g severity={{severity}}^priority={{priority}}. Note: If a short description filter is present in the template it will override the short description provided above.
  • Number of results to return (Optional): Limit the number of query results returned.
  • Include inactive tickets: Include inactive tickets within the query results.

Output of Action:
json containing following items:

  • has_error: True/False
  • error: message/null
  • result: Ticket details.

Search Users

Searches your ServiceNow instance for users with the specified details whenever the parent table has any results.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Username Column Name: Column name that contains the user name to be queried.
  • Custom Query String Column Name: Column name that contains a user-defined query string to be used instead of the default 'user_name' query.
  • Specific Fields To Return Column Name (Optional): Column name that contains the specific fields to be returned.

Output of Action:
json containing following items:

  • has_error: True/False
  • error: message/null
  • result: User details.

Get Attachments Metadata

Gets the metadata for multiple attachments.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Sysparm Query (Optional): Jinja-templated query. Queries for the Attachment API are relative to the Attachments [sys_attachment] table. For example: file_name={{filename}}
  • Limit (Optional): Limit to be applied on pagination. Unusually large values can impact system performance. (Default is 10000)
  • Offset (Optional): Number of records to exclude from the query. Use with "Limit" to paginate the results. (Default is 0)

Output of Action:
multiple rows of json containing details for each attachment:

  • has_error: True/False
  • error: message/null
  • other keys containing details of the attachment

Get Attachment Metadata

Gets the metadata for the attachment file with a specific sys_id value.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Sys ID: Select column containing the value for sys id

Output of Action:
json containing details for attachment:

  • has_error: True/False
  • error: message/null
  • other keys containing details of attachment

Download Attachment

Gets the binary file attachment with a specific sys_id value.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Sys ID: Select column containing the value for sys id

Output of Action:
json containing details of downloaded attachment:

  • has_error: True/False
  • error: message/null
  • lhub_file_id: file-id of the downloaded attachment local to LogicHub

Upload Attachment

Uploads the specified binary file as an attachment.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • File ID: Select column containing the value for LogicHub File Id of the attachment file you want to upload.
  • File Name (Optional): Select column containing the value for file name to give to the attachment. Leaving it empty or blank column values will assign LogicHub file id as the name of the uploaded attachment.
  • Table Name: Select column containing the value for the table name to attach the file to.
  • Table Sys ID: Select column containing the value for sys_id of the record on the specified table that you want to attach the file to.
  • Encryption Context (Optional): Select column containing the value for sys_id of an encryption context record. Specify this parameter to allow only users with the specified encryption context to access the attachment. If you do not specify this parameter (or the column-value is blank), the attached file is not encrypted with an encryption context.

Output of Action:
json containing details of uploaded attachment:

  • has_error: True/False
  • error: message/null
  • other keys containing details of attachment

Delete Attachment

Deletes the attachment file with a specific sys_id value.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Sys ID: Select column containing the value for sys id

Output of Action:
json containing details of uploaded attachment:

  • has_error: True/False
  • error: message/null
  • msg: Successfully deleted

Get Ticket From Table

This action retrieves the record identified by the specified sys_id from the specified table.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Jinja Template Table Name: Jinja-templated text containing the value for table name. Example: {{table_name_column}}.
  • Jinja Template Sys ID: Jinja-templated text containing the value for Sys ID. Example: {{sys_id_column}}.

Output of Action:
json containing details of uploaded attachment:

  • has_error: True/False
  • error: message/null
  • msg: Table details
{
  "has_error": false,
  "result": {
    "task_effective_number": "INC0010112",
    "additional_assignee_list": "",
    "sla_due": "",
    "follow_up": "",
    "knowledge": "false",
    "location": "",
    "work_start": "",
    "opened_by": {
      "link": "https://dev.service-now.com/api/now/v2/table/sys_user/6816f79cc0a8016401c5a33be04be441",
      "value": "6816f79cc0a8016401c5a33be04be441"
    },
    "due_date": "",
    "sys_updated_on": "2019-07-29 18:49:28",
    "reopen_count": "0",
    "service_offering": "",
    "closed_by": "",
    "incident_state": "1",
    "reopened_by": "",
    "impact": "3",
    "work_notes_list": "",
    "rfc": "",
    "sys_domain": {
      "link": "https://dev.service-now.com/api/now/v2/table/sys_user_group/global",
      "value": "global"
    },
    "escalation": "0",
    "made_sla": "true",
    "group_list": "",
    "sys_mod_count": "0",
    "closed_at": "",
    "category": "inquiry",
    "close_notes": "",
    "route_reason": "",
    "sys_updated_by": "admin",
    "caused_by": "",
    "comments": "",
    "activity_due": "",
    "state": "1",
    "opened_at": "2019-07-29 18:48:43",
    "cmdb_ci": "",
    "sys_tags": "",
    "sys_class_name": "incident",
    "delivery_plan": "",
    "parent": "",
    "business_duration": "",
    "work_notes": "",
    "time_worked": "",
    "active": "true",
    "approval": "not requested",
    "resolved_at": "",
    "work_end": "",
    "sys_created_on": "2019-07-29 18:49:28",
    "contract": "",
    "correlation_display": "",
    "assignment_group": "",
    "subcategory": "",
    "business_service": "",
    "delivery_task": "",
    "number": "INC0010112",
    "universal_request": "",
    "notify": "1",
    "resolved_by": "",
    "upon_reject": "cancel",
    "upon_approval": "proceed",
    "expected_start": "",
    "calendar_stc": "",
    "hold_reason": "",
    "priority": "5",
    "sys_id": "552c48888c033300964f4932b03eb092",
    "child_incidents": "0",
    "company": "",
    "parent_incident": "",
    "reopened_time": "",
    "user_input": "",
    "watch_list": "",
    "caller_id": {
      "link": "https://dev.service-now.com/api/now/v2/table/sys_user/005d500b536073005e0addeeff7b12f4",
      "value": "005d500b536073005e0addeeff7b12f4"
    },
    "correlation_id": "",
    "severity": "3",
    "sys_created_by": "admin",
    "short_description": "Assessment :  ATF Assessor",
    "comments_and_work_notes": "",
    "business_stc": "",
    "description": "",
    "reassignment_count": "0",
    "approval_history": "",
    "calendar_duration": "",
    "sys_domain_path": "/",
    "problem_id": "",
    "contact_type": "",
    "close_code": "",
    "assigned_to": "",
    "approval_set": "",
    "order": "",
    "urgency": "3"
  },
  "error": null
}

Advanced API Query

Searches your ServiceNow instance for tickets with the specified details whenever the parent table has any results.

Inputs to this Action:

  • Connection: Choose a connection that you have created.
  • Jinja Template Table Name: Jinja-templated text containing the value for table name. Example: {{table_name_column}}.
  • Jinja Template Advanced API Query (Optional): Jinja-templated text for advanced api query. Example: sysparm_query=sys_id={{sys_id}}^priority={{priority}}.
    For excluding inactive tickets include sysparm_query=active=true in here.
    For sorting the results by number field include sysparm_query=ORDERBYDESCnumber in here.
    For more information on all the parameters please refer: https://docs.servicenow.com/bundle/paris-application-development/page/integrate/inbound-rest/concept/c_TableAPI.html#c_TableAPI
  • Number of results to return (Optional): Limit the number of query results returned (Default is 100,000).

Output of Action:
json containing details of uploaded attachment:

  • has_error: True/False
  • error: message/null
  • msg: Table details
{
  "match_found": "true",
  "all_incidents": [
    {
      "sys_id": "552c48888c033300964f4932b03eb092",
      "number": "INC0010112"
    },
    {
      "sys_id": "a83820b58f723300e7e16c7827bdeed2",
      "number": "INC0010111"
    },
    {
      "sys_id": "73fb0e0d2f272010bf2559a72799b682",
      "number": "INC0010002"
    },
    {
      "sys_id": "6646b98d2f232010bf2559a72799b69a",
      "number": "INC0010001"
    },
    {
      "sys_id": "57af7aec73d423002728660c4cf6a71c",
      "number": "INC0009009"
    },
    {
      "sys_id": "ed92e8d173d023002728660c4cf6a7bc",
      "number": "INC0009005"
    },
    {
      "sys_id": "a623cdb073a023002728660c4cf6a768",
      "number": "INC0009001"
    },
    {
      "sys_id": "ff4c21c4735123002728660c4cf6a758",
      "number": "INC0007002"
    },
    {
      "sys_id": "f12ca184735123002728660c4cf6a7ef",
      "number": "INC0007001"
    },
    {
      "sys_id": "a2496c05731110107418660c4cf6a711",
      "number": "INC0001990"
    },
    {
      "sys_id": "85071a1347c12200e0ef563dbb9a71c1",
      "number": "INC0000059"
    },
    {
      "sys_id": "965c9e5347c12200e0ef563dbb9a7156",
      "number": "INC0000058"
    },
    {
      "sys_id": "78271e1347c12200e0ef563dbb9a7109",
      "number": "INC0000057"
    },
    {
      "sys_id": "d71f7935c0a8016700802b64c67c11c6",
      "number": "INC0000055"
    },
    {
      "sys_id": "d71da88ac0a801670061eabfe4b28f77",
      "number": "INC0000054"
    },
    {
      "sys_id": "d71b3b41c0a8016700a8ef040791e72a",
      "number": "INC0000053"
    },
    {
      "sys_id": "d7195138c0a8016700fd68449cfcd484",
      "number": "INC0000052"
    },
    {
      "sys_id": "d7158da0c0a8016700eef46c8d1f3661",
      "number": "INC0000051"
    },
    {
      "sys_id": "ef43c6d40a0a0b5700c77f9bf387afe3",
      "number": "INC0000050"
    },
    {
      "sys_id": "ef4225a40a0a0b5700d0b8a790747812",
      "number": "INC0000049"
    },
    {
      "sys_id": "a9e428cac61122760075710592216c58",
      "number": "INC0000048"
    },
    {
      "sys_id": "a9a16740c61122760004fe9095b7ddca",
      "number": "INC0000047"
    },
    {
      "sys_id": "a9e30c7dc61122760116894de7bcc7bd",
      "number": "INC0000046"
    },
    {
      "sys_id": "47204688a9fe1981011a20af100f381a",
      "number": "INC0000044"
    },
    {
      "sys_id": "471eb058a9fe198100f89592e1ea93d3",
      "number": "INC0000041"
    },
    {
      "sys_id": "471d4732a9fe198100affbf655e59172",
      "number": "INC0000040"
    },
    {
      "sys_id": "471bfbc7a9fe198101e77a3e10e5d47f",
      "number": "INC0000039"
    },
    {
      "sys_id": "4715ab62a9fe1981018c3efb96143495",
      "number": "INC0000037"
    },
    {
      "sys_id": "47064b68a9fe19810186793eefffc9b7",
      "number": "INC0000031"
    },
    {
      "sys_id": "46f67787a9fe198101e06dfcf3a78e99",
      "number": "INC0000029"
    },
    {
      "sys_id": "46f4f4dfa9fe198100063e60278f76ec",
      "number": "INC0000027"
    },
    {
      "sys_id": "46f09e75a9fe198100f4ffd8d366d17b",
      "number": "INC0000025"
    },
    {
      "sys_id": "46edaa6aa9fe198101b9d14ced16619f",
      "number": "INC0000020"
    },
    {
      "sys_id": "46e8219ba9fe1981013806b6e04fed06",
      "number": "INC0000019"
    },
    {
      "sys_id": "46e57642a9fe1981000b96a5dca501ff",
      "number": "INC0000018"
    },
    {
      "sys_id": "46e482d9a9fe198101d3e3f3e2a14459",
      "number": "INC0000017"
    },
    {
      "sys_id": "46e3e949a9fe19810069b824ba2c761a",
      "number": "INC0000016"
    },
    {
      "sys_id": "46e2fee9a9fe19810049b49dee0daf58",
      "number": "INC0000015"
    },
    {
      "sys_id": "8d6353eac0a8016400d8a125ca14fc1f",
      "number": "INC0000007"
    },
    {
      "sys_id": "e8caedcbc0a80164017df472f39eaed1",
      "number": "INC0000003"
    },
    {
      "sys_id": "9d385017c611228701d22104cc95c371",
      "number": "INC0000002"
    }
  ],
  "has_error": false,
  "error": null,
  "newest_incident": {
    "sys_id": "552c48888c033300964f4932b03eb092",
    "number": "INC0010112"
  }
}

Did this page help you?