> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

Interact with ServiceNow records & incidents

This guide demonstrates how to implement self-service actions that create, update, trigger, and delete ServiceNow records and incidents directly from Port.

Implement with AI

Send this guide to your coding agent.

Prerequisite: Install Port MCP

Open plan mode. Implement this Port guide in my org via MCP:

https://docs.port.io/guides/all/interact-with-servicenow/

Goal: get the guide's core flow working end-to-end in my org; adapting it to fit my existing setup takes priority over matching the guide 1:1.

Plan:
1. Confirm MCP is connected, in the right org, with sufficient permissions.
2. Diff the guide's data model (blueprints, properties, relations, actions, agents, automations, integrations, secrets) against mine.
3. Propose adaptations for gaps, reusing existing blueprints/relations over guide-named duplicates.
4. Flag what needs a UI click, credential, or secret from me, testing MCP capability empirically before ruling anything out.
5. Stop on any blocker and give me options. Approving this plan authorizes the writes it lists; pause only for writes beyond what's listed.

Build:
- Extend blueprint schema additively when upserting; don't remove or overwrite existing properties, and treat type conflicts as a blocker, not an auto-fix.
- List any mock data in the plan, minimal and labeled mock; once approved, seed it without re-asking, and tell me what you seeded.
- For anything the guide writes downstream (e.g. a webhook target), use a real entity, not a mock.
- For pages/widgets, use the real page identifier from the app URL, not a guessed slug.
- When you hit a UI step confirmed (not assumed) unsupported via MCP, pause, give exact clicks, then resume via MCP.
- Validate and give links after each meaningful step (only a tool-returned URL, no guessed paths); don't proceed if the last run wasn't a success.

Done:
- Confirm the guide's expected output exists and runs in Port.
- Summarize adaptations, seeded data, what was mocked or skipped, remaining UI steps, and how to verify.

Common use cases

  • Provide developers and managers with safe, self-serve operations on ServiceNow records.
  • Create ServiceNow incidents from Port using a synced webhook or a GitHub workflow.
  • Automate table record creation, updates, or removal as part of CI/CD or maintenance workflows.
  • Keep ServiceNow incident entities in Port aligned after incident creation or deletion.

Prerequisites

  • Complete the onboarding process.
  • Access to your ServiceNow account with permissions to manage records in relevant tables.
  • ServiceNow instance URL, username, and password. You can get these credentials from your ServiceNow account.
  • Optional - Install Port's ServiceNow integration. The integration creates the ServiceNow incident blueprint and keeps ServiceNow incident data updated in Port.
ServiceNow integration

The ServiceNow integration is optional for these examples, but it creates the incident blueprint boilerplate for you.

Set up data model

If you have not installed the ServiceNow integration, create the ServiceNow incident blueprint before setting up incident actions.

Create the ServiceNow incident blueprint

  1. Go to the Builder page.

  2. Click + Blueprint.

  3. Click Edit JSON.

  4. Copy and paste the following JSON configuration into the editor:

    ServiceNow incident blueprint (Click to expand)
    {
    "identifier": "servicenowIncident",
    "title": "ServiceNow Incident",
    "icon": "Service",
    "schema": {
    "properties": {
    "category": {
    "title": "Category",
    "type": "string"
    },
    "reopenCount": {
    "title": "Reopen Count",
    "type": "string"
    },
    "severity": {
    "title": "Severity",
    "type": "string"
    },
    "assignedTo": {
    "title": "Assigned To",
    "type": "string",
    "format": "url"
    },
    "urgency": {
    "title": "Urgency",
    "type": "string"
    },
    "contactType": {
    "title": "Contact Type",
    "type": "string"
    },
    "createdOn": {
    "title": "Created On",
    "type": "string",
    "format": "date-time"
    },
    "createdBy": {
    "title": "Created By",
    "type": "string"
    },
    "isActive": {
    "title": "Is Active",
    "type": "boolean"
    },
    "priority": {
    "title": "Priority",
    "type": "string"
    }
    },
    "required": []
    },
    "mirrorProperties": {},
    "calculationProperties": {},
    "aggregationProperties": {},
    "relations": {}
    }
  5. Click Save.

Set up Port secrets

Existing secrets

If you have already installed Port's ServiceNow integration, these secrets should already exist in Port. To view your existing secrets:

  1. In your Port application, click on your profile picture .
  2. Choose Credentials, then click on the Secrets tab.

To add a secret to Port:

  1. In your Port application, click on your profile picture .

  2. Click on Credentials.

  3. Click on the Secrets tab.

  4. Click on + Secret and add the following secrets:

    • SERVICENOW_INSTANCE_URL - The ServiceNow instance URL. For example, https://example-id.service-now.com.

    • SERVICENOW_API_TOKEN - A base64 encoded string of your ServiceNow instance credentials generated with:

      echo -n "your-instance-username:your-instance-password" | base64

Set up self-service actions

To enable interaction with ServiceNow from Port, we will configure five self-service actions:

  • Create a ServiceNow record

  • Update a ServiceNow record

  • Delete a ServiceNow record

  • Trigger a ServiceNow incident

  • Delete a ServiceNow incident

These actions use Port's synced webhooks to communicate with ServiceNow's REST API. The incident creation action also supports a GitHub workflow path for teams that prefer to keep automation logic in Git.

Create a ServiceNow record

  1. Go to the Self-service page in Port.

  2. Click on the + New Action button.

  3. Click on the {...} Edit JSON button.

  4. Copy and paste the following JSON configuration into the editor:

    Create a ServiceNow record (Click to expand)
    {
    "identifier": "create_servicenow_record",
    "title": "Create ServiceNow Record",
    "icon": "Servicenow",
    "description": "Create a new record in a specified table in ServiceNow using a JSON payload",
    "trigger": {
    "type": "self-service",
    "operation": "CREATE",
    "userInputs": {
    "properties": {
    "table_name": {
    "icon": "DefaultProperty",
    "type": "string",
    "title": "Table Name",
    "description": "Name of the table in ServiceNow"
    },
    "request_body": {
    "type": "object",
    "title": "Request Body ",
    "description": "JSON payload for the new record. The payload must follow the table schema in ServiceNow"
    }
    },
    "required": [
    "request_body",
    "table_name"
    ],
    "order": [
    "table_name",
    "request_body"
    ]
    }
    },
    "invocationMethod": {
    "type": "WEBHOOK",
    "url": "{{.secrets.SERVICENOW_INSTANCE_URL}}/api/now/table/{{.inputs.table_name}}",
    "agent": false,
    "synchronized": true,
    "method": "POST",
    "headers": {
    "RUN_ID": "{{ .run.id }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic {{.secrets.SERVICENOW_API_TOKEN}}"
    },
    "body": {
    "{{ spreadValue() }}": "{{ .inputs.request_body }}"
    }
    },
    "requiredApproval": false
    }
  5. Click Save to create the action.

Now you should see the Create ServiceNow Record action in the Self-service page.

Update a ServiceNow record

  1. Go to the Self-service page in Port.

  2. Click on the + New Action button.

  3. Click on the {...} Edit JSON button.

  4. Copy and paste the following JSON configuration into the editor:

    Update a ServiceNow record (Click to expand)
    {
    "identifier": "update_service_now_record",
    "title": "Update ServiceNow Record",
    "icon": "Servicenow",
    "description": "Update an existing record in a specified table in ServiceNow based on system ID and a JSON payload",
    "trigger": {
    "type": "self-service",
    "operation": "DAY-2",
    "userInputs": {
    "properties": {
    "table_name": {
    "type": "string",
    "title": "Table Name",
    "description": "Name of the table in ServiceNow"
    },
    "request_body": {
    "type": "object",
    "title": "Request Body ",
    "description": "JSON payload containing the fields and values to update in the record. Must follow the table schema in ServiceNow"
    },
    "system_id": {
    "type": "string",
    "title": "System ID",
    "description": "Globally Unique ID (GUID) of the record in ServiceNow"
    }
    },
    "required": [
    "table_name",
    "request_body",
    "system_id"
    ],
    "order": [
    "table_name",
    "system_id",
    "request_body"
    ]
    }
    },
    "invocationMethod": {
    "type": "WEBHOOK",
    "url": "{{.secrets.SERVICENOW_INSTANCE_URL}}/api/now/table/{{.inputs.table_name}}/{{.inputs.system_id}}",
    "agent": false,
    "synchronized": true,
    "method": "PATCH",
    "headers": {
    "RUN_ID": "{{ .run.id }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic {{.secrets.SERVICENOW_API_TOKEN}}"
    },
    "body": {
    "{{ spreadValue() }}": "{{ .inputs.request_body }}"
    }
    },
    "requiredApproval": false
    }
  5. Click Save to create the action.

Now you should see the Update ServiceNow Record action in the Self-service page.

Delete a ServiceNow record

  1. Go to the Self-service page in Port.

  2. Click on the + New Action button.

  3. Click on the {...} Edit JSON button.

  4. Copy and paste the following JSON configuration into the editor:

    Delete a ServiceNow record (Click to expand)
    {
    "identifier": "delete_service_now_record",
    "title": "Delete ServiceNow Record",
    "icon": "Servicenow",
    "description": "Delete a record based on system ID from a specified table in ServiceNow",
    "trigger": {
    "type": "self-service",
    "operation": "DELETE",
    "userInputs": {
    "properties": {
    "table_name": {
    "icon": "DefaultProperty",
    "type": "string",
    "title": "Table Name",
    "description": "Name of the table in ServiceNow"
    },
    "system_id": {
    "type": "string",
    "title": "System ID",
    "description": "Globally Unique ID (GUID) of the record in ServiceNow"
    }
    },
    "required": [
    "system_id",
    "table_name"
    ],
    "order": [
    "table_name",
    "system_id"
    ]
    }
    },
    "invocationMethod": {
    "type": "WEBHOOK",
    "url": "{{.secrets.SERVICENOW_INSTANCE_URL}}/api/now/table/{{.inputs.table_name}}/{{.inputs.system_id}}",
    "agent": false,
    "synchronized": true,
    "method": "DELETE",
    "headers": {
    "RUN_ID": "{{ .run.id }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic {{.secrets.SERVICENOW_API_TOKEN}}"
    },
    "body": {}
    },
    "requiredApproval": false
    }
  5. Click Save to create the action.

Now you should see the Delete ServiceNow Record action in the Self-service page.

Trigger a ServiceNow incident

You can trigger ServiceNow incidents from Port in two ways:

  • Synced webhook - Use Port secrets and a synced webhook to call the ServiceNow API directly.
  • GitHub workflow - Dispatch a GitHub workflow when you want to keep custom automation logic in Git.

Set up self-service action

Follow the steps below to create a self-service action that triggers ServiceNow incidents with a synced webhook.

  1. Go to the Self-service page in Port.

  2. Click on the + New Action button.

  3. Click on the {...} Edit JSON button.

  4. Copy and paste the following JSON configuration into the editor:

    Trigger ServiceNow incident with webhook (Click to expand)
    {
    "identifier": "servicenowIncident_trigger_incident_webhook",
    "title": "Trigger ServiceNow incident (Webhook)",
    "icon": "Service",
    "description": "Trigger a new incident in ServiceNow using webhook",
    "trigger": {
    "type": "self-service",
    "operation": "CREATE",
    "userInputs": {
    "properties": {
    "short_description": {
    "icon": "DefaultProperty",
    "title": "Short Description",
    "description": "Description of the incident",
    "type": "string"
    },
    "assigned_to": {
    "icon": "DefaultProperty",
    "title": "Assigned To",
    "description": "User this incident is assigned to",
    "type": "string"
    },
    "urgency": {
    "title": "Urgency",
    "icon": "DefaultProperty",
    "type": "string",
    "default": "2",
    "enum": [
    "1",
    "2",
    "3"
    ],
    "enumColors": {
    "1": "red",
    "2": "yellow",
    "3": "green"
    }
    },
    "sysparm_display_value": {
    "title": "Sysparm Display Value",
    "description": "Determines the type of data returned",
    "icon": "DefaultProperty",
    "type": "string",
    "default": "all",
    "enum": [
    "true",
    "false",
    "all"
    ]
    },
    "sysparm_input_display_value": {
    "title": "Sysparm Input Display Value",
    "description": "Flag that indicates whether to set field values using the display value or the actual value",
    "type": "boolean",
    "default": false
    }
    },
    "required": [
    "short_description",
    "assigned_to"
    ],
    "order": [
    "short_description",
    "assigned_to",
    "urgency",
    "sysparm_display_value",
    "sysparm_input_display_value"
    ]
    },
    "blueprintIdentifier": "servicenowIncident"
    },
    "invocationMethod": {
    "type": "WEBHOOK",
    "url": "{{.secrets.SERVICENOW_INSTANCE_URL}}/api/now/table/incident",
    "agent": false,
    "synchronized": true,
    "method": "POST",
    "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic {{.secrets.SERVICENOW_API_TOKEN}}"
    },
    "body": {
    "short_description": "{{.inputs.short_description}}",
    "assigned_to": "{{.inputs.assigned_to}}",
    "urgency": "{{.inputs.urgency}}",
    "sysparm_display_value": "{{.inputs.sysparm_display_value}}",
    "sysparm_input_display_value": "{{.inputs.sysparm_input_display_value}}"
    }
    },
    "requiredApproval": false
    }
  5. Click Save to create the action.

Create automation

After each successful action run, create an automation that upserts the created ServiceNow incident back into Port.

  1. Go to the Automations page in Port.

  2. Click on the + Automation button.

  3. Copy and paste the following JSON configuration into the editor.

    Update ServiceNow incident in Port automation (Click to expand)
    {
    "identifier": "servicenowIncident_sync_after_trigger",
    "title": "Sync ServiceNow Incident After Trigger",
    "description": "Update ServiceNow incident data in Port after triggering",
    "trigger": {
    "type": "automation",
    "event": {
    "type": "RUN_UPDATED",
    "actionIdentifier": "servicenowIncident_trigger_incident_webhook"
    },
    "condition": {
    "type": "JQ",
    "expressions": [
    ".diff.after.status == \"SUCCESS\""
    ],
    "combinator": "and"
    }
    },
    "invocationMethod": {
    "type": "UPSERT_ENTITY",
    "blueprintIdentifier": "servicenowIncident",
    "mapping": {
    "identifier": "{{.event.diff.after.response.result.number}}",
    "title": "{{.event.diff.after.response.result.short_description}}",
    "properties": {
    "category": "{{.event.diff.after.response.result.category}}",
    "reopenCount": "{{.event.diff.after.response.result.reopen_count}}",
    "severity": "{{.event.diff.after.response.result.severity}}",
    "assignedTo": "{{.event.diff.after.response.result.assigned_to.link}}",
    "urgency": "{{.event.diff.after.response.result.urgency}}",
    "contactType": "{{.event.diff.after.response.result.contact_type}}",
    "createdOn": "{{.event.diff.after.response.result.sys_created_on}}",
    "createdBy": "{{.event.diff.after.response.result.sys_created_by}}",
    "isActive": "{{.event.diff.after.response.result.active}}",
    "priority": "{{.event.diff.after.response.result.priority}}"
    }
    }
    },
    "publish": true
    }
  4. Click Save to create the automation.

Delete a ServiceNow incident

  1. Go to the Self-service page in Port.

  2. Click on the + New Action button.

  3. Click on the {...} Edit JSON button.

  4. Copy and paste the following JSON configuration into the editor:

    Delete ServiceNow incident (Click to expand)
    {
    "identifier": "delete_servicenow_incident",
    "title": "Delete ServiceNow Incident",
    "icon": "Servicenow",
    "description": "Deletes an incident from the ServiceNow incident table using a unique system ID",
    "trigger": {
    "type": "self-service",
    "operation": "DELETE",
    "userInputs": {
    "properties": {},
    "required": [],
    "order": []
    },
    "blueprintIdentifier": "servicenowIncident"
    },
    "invocationMethod": {
    "type": "WEBHOOK",
    "url": "{{.secrets.SERVICENOW_INSTANCE_URL}}/api/now/table/incident/{{.entity.identifier}}",
    "agent": false,
    "synchronized": true,
    "method": "DELETE",
    "headers": {
    "RUN_ID": "{{ .run.id }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic {{.secrets.SERVICENOW_API_TOKEN}}"
    },
    "body": {}
    },
    "requiredApproval": false
    }
  5. Click Save to create the action.

Now you should see the Delete ServiceNow Incident action in the Self-service page.

Create automation

Once the incident is deleted from ServiceNow, create an automation that removes the corresponding entity from Port.

  1. Go to the Automations page in Port.

  2. Click on the + Automation button.

  3. Copy and paste the following JSON configuration into the editor.

    Delete ServiceNow incident in Port automation (Click to expand)
    {
    "identifier": "servicenow_incident_delete_sync_status",
    "title": "Remove Deleted Incident from Port",
    "description": "Removes the deleted entity in Port when after it is deleted from ServiceNow",
    "trigger": {
    "type": "automation",
    "event": {
    "type": "RUN_UPDATED",
    "actionIdentifier": "delete_servicenow_incident"
    },
    "condition": {
    "type": "JQ",
    "expressions": [
    ".diff.after.status == \"SUCCESS\""
    ],
    "combinator": "and"
    }
    },
    "invocationMethod": {
    "type": "WEBHOOK",
    "url": "https://api.port.io/v1/blueprints/{{.event.diff.after.blueprint.identifier}}/entities/{{.event.diff.after.entity.identifier}}",
    "agent": false,
    "synchronized": true,
    "method": "DELETE",
    "headers": {
    "RUN_ID": "{{.event.diff.after.id}}",
    "Content-Type": "application/json",
    "Accept": "application/json"
    },
    "body": {}
    },
    "publish": true
    }
  4. Click Save to create the automation.

Now, whenever a user runs the Delete ServiceNow Incident action:

  1. The incident is deleted directly from ServiceNow via webhook.
  2. The corresponding entity in Port is automatically removed, keeping your catalog clean and consistent.

Let's test it!

  1. Go to the Self-service page in Port.

  2. Run one of the ServiceNow actions you created.

  3. Fill in the required fields for the selected action.

  4. Click Execute.

  5. Open your ServiceNow instance and verify that the record or incident was created, updated, or deleted as expected.