# Get Request Type Form — Jira Service Desk

> Gets the form attached to a request type, so you can ask the user each question and pass their answers in the form argument of Create Request. Forms are separate from the fields that List Request Type Fields returns: a request type can…

- Key: `jira_service_desk-get-request-type-form`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Jira Service Desk (`jira_service_desk`) — https://pipedream.com/apps/jira-service-desk.md
- This page (HTML): https://pipedream.com/apps/jira-service-desk/actions/get-request-type-form
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/jira_service_desk/actions/get-request-type-form/get-request-type-form.mjs

## Description

Gets the form attached to a request type, so you can ask the user each question and pass their answers in the `form` argument of **Create Request**. Forms are separate from the fields that **List Request Type Fields** returns: a request type can have both, and a request created without its form's answers is created with no form at all. Returns `hasForm` (`false` when the request type has no form), the form's `name`, and its `questions` in the order the form shows them. Each question gives the `questionId` to key its answer by, its `label`, `typeName`, whether it is `required`, the `answerFormat` its answer must follow, and for choice questions the `choices` whose `id`s go in the answer. A question with `conditions` is shown or hidden depending on another question's answer, e.g. `{ "effect": "show", "whenAnyChoiceSelected": { "12": ["2"] } }` means it only appears, and is only required, when question `12` has choice `2` selected; answers to hidden questions are dropped. Example: a question `{ "questionId": "2", "label": "Licence type", "typeName": "Radio buttons", "choices": [{ "id": "1", "label": "Free" }, { "id": "2", "label": "Paid" }] }` is answered as `{ "2": { "choices": ["2"] } }`. Use **List Sites** for `cloudId`, **List Service Desks** for `serviceDeskId`, and **List Request Types** for `requestTypeId`. [See the documentation](https://developer.atlassian.com/cloud/forms/rest/api-group-forms-on-portal/#api-servicedesk-servicedeskid-requesttype-requesttypeid-form-get)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `cloudId` | `string` | Yes | The Atlassian site (cloud) ID, e.g. 822faf0d-5427-420e-9016-999d3dc76918. Run List Sites to get the id of every site you can access. |
| `serviceDeskId` | `string` | Yes | The service desk the request type belongs to. Use List Service Desks to find valid IDs (e.g. 1). |
| `requestTypeId` | `string` | Yes | The request type whose form to get. Use List Request Types to find valid IDs (e.g. 5). |
| `requestLanguage` | `string` | No | Locale to translate the form's labels into, e.g. de-DE. Defaults to the form's own language. |

## 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_service_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: "jira_service_desk-get-request-type-form",
  arguments: {
    cloudId: "Cloud ID",
    serviceDeskId: "Service Desk 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: "jira_service_desk-get-request-type-form",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    jira_service_desk: { authProvisionId: "apn_xxxxxxx" },
    cloudId: "Cloud ID",
    serviceDeskId: "Service Desk 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": "jira_service_desk-get-request-type-form",
    "configured_props": {
      "jira_service_desk": { "authProvisionId": "apn_xxxxxxx" },
      "cloudId": "Cloud ID",
      "serviceDeskId": "Service Desk ID"
    }
  }'
```

---

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