# linear_template (Resource)

Manages a Linear template — the pre-filled shape new issues, projects or documents start from.

The template body is deeply nested and its schema follows the entity it templates, so it goes through as raw JSON in `template_json` rather than typed HCL.

## Example Usage

```terraform
resource "linear_template" "incident" {
  team_id = linear_team.engineering.id
  name    = "Incident"
  type    = "issue"
  color   = "#eb5757"

  template_json = jsonencode({
    title       = "Incident: "
    priority    = 1
    description = "## Impact\n\n## Timeline\n\n## Root cause\n"
  })
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the template.
- `template_json` (String) Template body as a JSON object — the pre-filled attributes of the target entity, e.g. `jsonencode({ title = "Incident", priority = 1 })` for an issue template. Compared semantically, so formatting differences are not drift.
- `type` (String) Entity the template applies to, e.g. `issue`, `project`, `document` or `releaseNote`. Changing it replaces the template — `templateUpdate` has no `type`.

### Optional

- `color` (String) Colour of the template icon as a hex string.
- `description` (String) Description of the template.
- `icon` (String) Icon of the template.
- `pipeline_id` (String) UUID of the `linear_release_pipeline` the template is bound to. Required when `type` is `releaseNote` and rejected otherwise; a pipeline takes at most one release note template. Changing it replaces the template.
- `sort_order` (Number) Sort position of the template in the template list. Linear assigns one when unset.
- `team_id` (String) UUID of the team the template belongs to. Leave unset to share the template across every team in the workspace.

### Read-Only

- `id` (String) UUID of the template.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Import by UUID.
terraform import linear_template.example a1b2c3d4-0000-0000-0000-000000000000
```