Ensure a GitHub project view
github_project_view_ensureEnsures a saved project board view exists: preserves an existing view with that name (case-insensitive) or creates a missing one with the specified layout, filter, fields, sorting, and grouping.
Instructions
Make sure a saved view exists on a project board the viewer may update: a view of that name (without regard to case) is left exactly as it is, and a missing one is created through the REST API with its layout, filter, fields, sorting and grouping. A field name the board lacks, fields on a roadmap, column_by on a layout other than board, grouping by Sub-issues progress or Linked pull requests and sort_desc without sort_by are invalid_argument, before anything is written. The API cannot set a roadmap's date fields. A board is named by project: its number, owner/number or its URL, used as it is; any other project is a title, and no project is Roadmap: the open board of that whole title is looked up, never guessed, in owner's boards if owner is given, else in the boards linked to repo, then its organization's, then the viewer's. Needs a token with the project scope; if GitHub reports missing scopes, run gh auth refresh -s project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The view's name, matched without regard to case. | |
| repo | No | owner/name; defaults to the working tree's repository (its origin). Where the board lookup starts, and the owner of a bare board number. | |
| owner | No | A user or organization login, or "@me": the owner of a numbered board, else the only owner searched for a title. | |
| fields | No | The fields shown, by name and in order (built-in ones too, such as Assignees or Parent issue); not for a roadmap. | |
| filter | No | A project filter, such as "-status:Done -status:Cancelled". | |
| layout | Yes | ||
| project | No | The board, as its number, owner/number or its URL (used as it is; a bare number takes owner, else the owner of repo or of the working tree's repository), or as its title, looked up among open boards (whole title, case-insensitive). Default: the title Roadmap. | |
| sort_by | No | A field name to sort by. | |
| group_by | No | A field name to group by; not Sub-issues progress or Linked pull requests. | |
| column_by | No | board layout only: the field name the columns follow. | |
| sort_desc | No | Sort descending (default false); needs sort_by. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view | Yes | ||
| created | Yes | Whether this call made the view; false when the board already had one of that name. | |
| project | Yes |