# Create Ticket — Teamwork Desk

> Create a new ticket See the documentation

- Key: `teamwork_desk-create-ticket`
- Type: Action (Write)
- Version: 0.0.3
- App: Teamwork Desk (`teamwork_desk`) — https://pipedream.com/apps/teamwork-desk.md
- This page (HTML): https://pipedream.com/apps/teamwork-desk/actions/create-ticket
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/teamwork_desk/actions/create-ticket/create-ticket.mjs

## Description

Create a new ticket [See the documentation](https://apidocs.teamwork.com/docs/desk/fe69a0fb1007a-create-a-new-customer)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `bcc` | `string[]` | No | List of BCC for the initial message. |
| `cc` | `string[]` | No | List of CC for the initial message. |
| `customerId` | `string` | Yes | The customer id. Options are loaded from the connected account. |
| `inboxId` | `string` | Yes | The id of the inbox. Options are loaded from the connected account. |
| `message` | `string` | Yes | The ticket's initial message. |
| `notifyCustomer` | `boolean` | Yes | Whether to notify the customer when an agent creates a ticket on behalf of the customer. |
| `priorityId` | `string` | Yes | The Id of the priority. Options are loaded from the connected account. |
| `sourceId` | `string` | Yes | The Id of the source. Options are loaded from the connected account. |
| `statusId` | `string` | Yes | The Id of the status. Options are loaded from the connected account. |
| `subject` | `string` | Yes | The ticket's subject. |
| `tagIds` | `string[]` | No | The list of word the ticket was tagged with. Options are loaded from the connected account. |
| `typeId` | `string` | Yes | The Id of the type. Options are loaded from the connected account. |

## 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": "teamwork_desk",
      },
    },
  },
)

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: "teamwork_desk-create-ticket",
  arguments: {
    bcc: ["BCC"],
    cc: ["CC"],
  },
})
```

**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: "teamwork_desk-create-ticket",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    teamwork_desk: { authProvisionId: "apn_xxxxxxx" },
    bcc: ["BCC"],
    cc: ["CC"],
  },
})

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": "teamwork_desk-create-ticket",
    "configured_props": {
      "teamwork_desk": { "authProvisionId": "apn_xxxxxxx" },
      "bcc": ["BCC"],
      "cc": ["CC"]
    }
  }'
```

---

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