# Update Incident — TOPdesk

> Updates an existing incident. See the documentation

- Key: `topdesk-update-incident`
- Type: Action (Write)
- Version: 0.0.3
- App: TOPdesk (`topdesk`) — https://pipedream.com/apps/topdesk.md
- This page (HTML): https://pipedream.com/apps/topdesk/actions/update-incident
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/topdesk/actions/update-incident/update-incident.mjs

## Description

Updates an existing incident. [See the documentation](https://developers.topdesk.com/explorer/?page=incident#/incident/patchIncident)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `incidentId` | `string` | Yes | The UUID of the incident Options are loaded from the connected account. |
| `callerLookupId` | `string` | No | Lookup value for filling in a registered caller's contact details (UUID). Can only be set by operators. Options are loaded from the connected account. |
| `briefDescription` | `string` | No | Brief description of the incident (max 80 characters) |
| `request` | `string` | No | The initial request text. HTML tags are supported: <i>, <em>, <b>, <strong>, <u>, <br>, <h5>, <h6> |
| `action` | `string` | No | The action text to add. HTML tags are supported: <i>, <em>, <b>, <strong>, <u>, <br>, <h5>, <h6> |
| `actionInvisibleForCaller` | `boolean` | No | Whether the action is invisible for persons. Can only be set by operators. |
| `categoryId` | `string` | No | The UUID of the category Options are loaded from the connected account. |
| `subcategoryId` | `string` | No | The UUID of the subcategory Options are loaded from the connected account. |
| `callTypeId` | `string` | No | The UUID of the call type Options are loaded from the connected account. |
| `callDate` | `string` | No | The date when this call was registered in ISO 8601 format (e.g., 2024-08-01T12:00:00.000+0200). Can only be set by operators. |
| `entryTypeId` | `string` | No | The UUID of the entry type Options are loaded from the connected account. |
| `externalNumber` | `string` | No | External number (max 60 characters). Can only be set by operators. |
| `objectName` | `string` | No | The UUID of the object (asset). Can only be set by operators. Options are loaded from the connected account. |
| `locationId` | `string` | No | The UUID of the location Options are loaded from the connected account. |
| `branchId` | `string` | No | The UUID of the branch Options are loaded from the connected account. |
| `impact` | `string` | No | The UUID of the impact Options are loaded from the connected account. |
| `urgency` | `string` | No | The UUID of the urgency Options are loaded from the connected account. |
| `priority` | `string` | No | The UUID of the priority Options are loaded from the connected account. |
| `duration` | `string` | No | The UUID of the duration Options are loaded from the connected account. |
| `targetDate` | `string` | No | Target date in ISO 8601 format (e.g., 2024-08-01T12:00:00.000+0200). Can only be set by operators. |
| `slaId` | `string` | No | The UUID of the SLA Options are loaded from the connected account. |
| `onHold` | `boolean` | No | Whether the incident is on hold. Can only be set by operators. |
| `operatorId` | `string` | No | The operator assigned to the incident. Can only be set by operators. Options are loaded from the connected account. |
| `operatorGroupId` | `string` | No | The UUID of the operator group Options are loaded from the connected account. |
| `supplierId` | `string` | No | The UUID of the supplier Options are loaded from the connected account. |
| `processingStatusId` | `string` | No | The UUID of the processing status Options are loaded from the connected account. |
| `responded` | `boolean` | No | Whether the incident is responded. SLM-licence is needed. Can only be set by operators. |
| `responseDate` | `string` | No | Response date in ISO 8601 format. SLM-licence is needed. Can only be set by operators. |
| `completed` | `boolean` | No | Whether the incident is completed. Can only be set by operators. |
| `completedDate` | `string` | No | Completed date in ISO 8601 format. Can only be set by operators. |
| `closed` | `boolean` | No | Whether the incident is closed. Can only be set by operators. |
| `closedDate` | `string` | No | Closed date in ISO 8601 format. Can only be set by operators. |
| `closureCodeId` | `string` | No | The UUID of the closure code Options are loaded from the connected account. |
| `costs` | `string` | No | Costs as a decimal number. Can only be set by operators. |
| `feedbackMessage` | `string` | No | Feedback message from the caller |
| `feedbackRating` | `integer` | No | Feedback rating (1-5). Can be set by persons. |
| `majorCall` | `boolean` | No | Whether the incident is a major call. Can only be set by operators. |
| `majorCallObject` | `object` | No | Major call details as a JSON object. Can only be set by operators. |
| `publishToSsd` | `boolean` | No | Whether to publish the incident to Self Service Desk. Can only be set by operators. |
| `optionalFields1` | `object` | No | Optional fields tab 1 as a JSON object |
| `optionalFields2` | `object` | No | Optional fields tab 2 as a JSON object |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "topdesk",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "topdesk-update-incident",
  arguments: {
    incidentId: "Incident ID",
    callerLookupId: "Caller Lookup ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "topdesk-update-incident",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    topdesk: { authProvisionId: "apn_xxxxxxx" },
    incidentId: "Incident ID",
    callerLookupId: "Caller Lookup ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "topdesk-update-incident",
    "configured_props": {
      "topdesk": { "authProvisionId": "apn_xxxxxxx" },
      "incidentId": "Incident ID",
      "callerLookupId": "Caller Lookup ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/topdesk.md · All apps: https://pipedream.com/apps
