# Create Issue — Jira

> Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. See the documentation

- Key: `jira-create-issue`
- Type: Action (Write)
- Version: 1.0.0
- App: Jira (`jira`) — https://pipedream.com/apps/jira.md
- This page (HTML): https://pipedream.com/apps/jira/actions/create-issue
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/jira/actions/create-issue/create-issue.mjs

## Description

Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. [See the documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `cloudId` | `string` | Yes | The Jira Cloud site ID (e.g., 11223344-a1b2-3b33-c444-def123456789). Use the Get Cloud ID action to look up the ID for your site. |
| `historyMetadata` | `object` | No | Additional issue history details |
| `properties` | `string` | No | Details of issue properties to be added or updated. Please provide an array of objects with keys and values. |
| `update` | `object` | No | Advanced: a Map of field names to a list of add/remove/set operations to perform (e.g. appending a value to a multi-value field), following Jira's issue update operations format. For setting field values directly (summary, description, priority, labels, etc.), use additionalProperties instead. |
| `updateHistory` | `boolean` | No | Whether the project in which the issue is created is added to the user's Recently viewed project list, as shown under Projects in Jira |
| `projectId` | `string` | Yes | The ID of the project the issue will be created in. Use the Get All Projects action to look up project IDs. |
| `issueTypeId` | `string` | Yes | An ID identifying the type of issue to create. Use the Get Issue Types action to look up issue type IDs for the project. |
| `additionalProperties` | `object` | Yes | The primary way to set issue field values not already covered by other props. Provide a flat object of Jira field keys to values, e.g. { "summary": "Fix login bug", "description": "Plain text is fine here", "priority": { "name": "High" }, "labels": ["bug"] }. description and environment may be given as plain strings — they're automatically converted to Jira's required document format. Use this instead of update for straightforward field assignments. Required — at least one field (e.g. summary) must be provided to create the issue. |

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

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: "jira-create-issue",
  arguments: {
    cloudId: "Cloud ID",
    historyMetadata: "History Metadata",
  },
})
```

**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: "jira-create-issue",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    jira: { authProvisionId: "apn_xxxxxxx" },
    cloudId: "Cloud ID",
    historyMetadata: "History Metadata",
  },
})

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": "jira-create-issue",
    "configured_props": {
      "jira": { "authProvisionId": "apn_xxxxxxx" },
      "cloudId": "Cloud ID",
      "historyMetadata": "History Metadata"
    }
  }'
```

---

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