All Collections
Best Practice Guides
Ticketing
Using POST and PATCH /tickets for ServiceNow
Using POST and PATCH /tickets for ServiceNow

How to create and update tickets directly in ServiceNow using POST and PATCH /Ticket

Yash Gogri avatar
Written by Yash Gogri
Updated over a week ago

ServiceNow is very complex, especially regarding the many ticket types and options they support. Below are some helpful tips when using Merge to POST and PATCH tickets to ServiceNow.

What types of tickets do Merge support with ServiceNow?

Merge supports pulling & creating all types of tasks in ServiceNow. We call the …

  • /task table to pull all types of tasks

  • /incident table to pull all incidents

  • /sc_request table to pull all requests

  • /sc_task table to pull all catalog tasks

  • /sn_customerservice_case table to pull all cases

  • /problem table to pull all problems

Supported non-common-model fields for ticket types

Below are the commonly supported types:

  • Incident

    • urgency

    • impact

    • category

    • subcategory

  • Problem

    • urgency

    • impact

    • category

    • subcategory

  • Catalog Task

    • cmdb_ci

    • request_item

    • approval

POST TICKET

To POST Ticket, simply use integration_params in the POST request body:

Using /meta to surface available options

  • Surface all available ticket_type by simply polling the GET /tickets/meta/post endpoint.

  • Surface the available options by adding the ticket_type=xxx query param to the GET /tickets/meta/post endpoint. For example, GET /tickets/meta/post?ticket_type=incident will surface the available options for category.

  • Some fields like subcategory are dependent on other field values like category. To surface those options, make a call like GET /tickets/meta/post?ticket_type=incident&category=database.

PATCH TICKET

Similarly, you can use the /meta endpoint and then PATCH /ticket. To edit a ServiceNow ticket, follow our recommended steps below:

Call GET /meta/patch/{ticket_id}?ticket_id={ticket_id} to get the available statuses for that Ticket. The response should look something like below:

Next call PATCH /tickets/{ticket_id} to edit the Ticket! Check our doc here to see what fields we support editing in ServiceNow.

POST + PATCH Tickets with Tags

  • By default, ServiceNow does not allow users to add/remove tags to Tickets via API. To bypass this rule, follow the steps below.

    1. Make sure you have elevated role of security_admin. Follow this guide here to elevate your role if you’re an admin. This particularly applies for developer sandbox accounts.

    2. Navigate to Access Control (ACL).

    3. Navigate to the ACL’s with write operations for label_entry.table and label_entry.table_key.

    4. Remove the “maint” required role. Note that this may bring up security concerns, so please proceed carefully.

    5. Click Update to save the changes.

    6. You’re all set! Now the ServiceNow integration can programmatically create & edit tags on tickets.

  • Other links:

    • ServiceNow help guide on Administering Tags

    • Create an ACL rule guide

Did this answer your question?