# linear_view_preferences (Resource)

Manages the workspace-wide display preferences of a Linear custom view — its layout, grouping, ordering and which columns are shown.

The preferences object has over 250 fields whose set follows what Linear's UI offers, so it goes through as JSON rather than typed HCL. Only the keys the configuration sets are read back, so drift is reported for the preferences under management and no others.

```terraform
resource "linear_view_preferences" "in_review" {
  custom_view_id = linear_custom_view.in_review.id
  view_type      = "customView"

  preferences_json = jsonencode({
    layout       = "board"
    issueGrouping = "assignee"
    viewOrdering = "priority"
  })
}
```

## Example Usage

```terraform
resource "linear_view_preferences" "in_review" {
  custom_view_id = linear_custom_view.in_review.id
  view_type      = "customView"

  # Only the keys set here are read back, so drift is reported for the
  # preferences under management and no others.
  preferences_json = jsonencode({
    layout        = "board"
    issueGrouping = "assignee"
    viewOrdering  = "priority"
    showSubIssues = true
  })
}
```

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

### Required

- `custom_view_id` (String) UUID of the `linear_custom_view` these preferences belong to. Changing it replaces the resource — Linear's `viewPreferencesUpdate` only takes the preferences themselves.
- `preferences_json` (String) Display preferences as a JSON object, e.g. `jsonencode({ layout = "board", issueGrouping = "assignee" })`. Keys are Linear's own `ViewPreferencesValues` field names. Compared semantically.
- `view_type` (String) Which Linear view surface the preferences apply to, e.g. `customView`, `board`, `project`, `cycle`. Changing it replaces the resource.

### Read-Only

- `id` (String) UUID of the view preferences.
- `type` (String) Scope of the preferences. Only `organization` — workspace-wide preferences — is managed here; per-user preferences are personal state, not configuration.

## 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 the custom view's UUID, not the preferences' own: the read path goes
# through the view. The preferences themselves come back on the first plan.
terraform import linear_view_preferences.example a1b2c3d4-0000-0000-0000-000000000000
```