# Jira issuetype field: set the work type through the API

URL: https://goingstellar.ro/reference/jira-fields/issuetype-field/

issuetype carries the work type (issue type in the API). Create takes {"id": ...} or {"name": ...}, and it is the required field that decides which other fields exist. The type must belong to the project's scheme, and changing it on an existing item through the field is a different, restricted operation.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| POST | `/rest/api/3/issue` | Creates a work item with fields.issuetype by id or name. |
| PUT | `/rest/api/3/issue/{issueIdOrKey}` | An edit that sets fields.issuetype is checked against the hierarchy rules. |
| GET | `/rest/api/3/issue/{issueIdOrKey}/editmeta` | Lists issuetype as required with no operations. |

## Examples

### POST /rest/api/3/issue

Creates a work item giving the project and the work type by id.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "project": {
      "id": "{projectId}"
    },
    "issuetype": {
      "id": "{issueTypeId}"
    },
    "summary": "Type given by id"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'project': {'id': '{projectId}'},
                     'issuetype': {'id': '{issueTypeId}'},
                     'summary': 'Type given by id'}},
)
print(r.status_code, r.text)
```

Response: HTTP 201

```
{
 "id": "10788",
 "key": "ZZREF-9",
 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10788"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /rest/api/3/issue

Leaves out the work type on create.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "project": {
      "key": "ZZREF"
    },
    "summary": "no type"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'project': {'key': 'ZZREF'}, 'summary': 'no type'}},
)
print(r.status_code, r.text)
```

Response: HTTP 400

```
{
 "errorMessages": [],
 "errors": {
  "issuetype": "Specify an issue type"
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /rest/api/3/issue

Names a work type that is not part of the project's scheme.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "project": {
      "key": "ZZREF"
    },
    "issuetype": {
      "name": "Bug"
    },
    "summary": "x"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'project': {'key': 'ZZREF'}, 'issuetype': {'name': 'Bug'}, 'summary': 'x'}},
)
print(r.status_code, r.text)
```

Response: HTTP 400

```
{
 "errorMessages": [],
 "errors": {
  "issuetype": "Specify a valid issue type"
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### PUT /rest/api/3/issue/{otherIssueKey}

Edits an existing Task into a Sub-task by name.

```bash
curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "issuetype": {
      "name": "Sub-task"
    }
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{otherIssueKey}'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/issue/{otherIssueKey}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'issuetype': {'name': 'Sub-task'}}},
)
print(r.status_code, r.text)
```

Response: HTTP 400

```
{
 "errorMessages": [],
 "errors": {
  "issuetype": "Issue type is a sub-task but parent issue key or id not specified."
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /rest/api/3/issuetype/{issueTypeId}

Reads the work type itself: the id, whether it is a sub-task and its hierarchy level.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "id": "10117",
 "name": "Task",
 "description": "A small, distinct piece of work.",
 "subtask": false,
 "hierarchyLevel": 0
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /rest/api/3/issue/{issueIdOrKey}/editmeta

The edit metadata marks issuetype as required and lists no operation.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/editmeta'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/editmeta',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "fields": {
  "issuetype": {
   "required": true,
   "schema": {
    "type": "issuetype",
    "system": "issuetype"
   },
   "operations": [],
   "allowedValues": [
    {
     "id": "10117",
     "name": "Task",
     "subtask": false,
     "hierarchyLevel": 0
    }
   ]
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- On create the work type may be given by id or by name, and both answered 201 (issue-create-type-by-id, issue-create-subtask).
- Without issuetype, create answered 400 with errors.issuetype set to Specify an issue type (sys-create-required-missing-type).
- A work type that is not in the project's scheme answered 400 with Specify a valid issue type (issue-create-type-other-project).
- Moving a Task to the sub-task type with a PUT answered 400 because no parent was given. The field is listed with an empty operations array in editmeta (issue-change-type-to-subtask, editmeta-zz).

## Pitfalls

- Work type names are defined per site and scheme. Look up the id from the project's create metadata when the name can change or be translated.
- A sub-task type needs a parent on create, and the same message appears when an edit tries to turn a Task into a sub-task.
- The edit metadata lists no operation for issuetype, so do not build a general edit form around it. Check the error body on the call you send.

## Questions and answers

### Should I send the work type by id or by name?

Both worked on create. An id is stable if someone renames the type, a name is easier to read in a script.

### Why is the field called issuetype when the UI says work type?

The API keeps the older names. Jira now says work item and work type in the UI, and the paths and field ids still use issue and issuetype.

## Related

- [parent](https://goingstellar.ro/reference/jira-fields/parent-field/)
- [List work types](https://goingstellar.ro/reference/jira-fields/issue-types-list/)
- [Sub-task work types](https://goingstellar.ro/reference/jira-fields/subtask-issue-types/)
- [Change the work type](https://goingstellar.ro/reference/jira-fields/change-issue-type/)
- [Work type by id or by name](https://goingstellar.ro/reference/jira-fields/issue-type-by-id-or-name/)
- [Which fields can be set: editmeta and createmeta](https://goingstellar.ro/reference/jira-fields/editmeta-createmeta-fields/)

## Sources

- [Issue types (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/)
- [Issues (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/)
- [Create issue (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post)
- [Get edit issue metadata (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-editmeta-get)

