project_view_items
Creates, updates, deletes, gets or lists a project_view_items resource.
Overview
| Name | project_view_items |
| Type | Resource |
| Id | github.projects.project_view_items |
Fields
The following fields are returned by SELECT queries:
- list_view_items_for_org
- list_view_items_for_user
Response
| Name | Datatype | Description |
|---|---|---|
id | number | The unique identifier of the project item. |
node_id | string | The node ID of the project item. |
archived_at | string (date-time) | The time when the item was archived. (example: 2022-04-28T12:00:00Z) |
content | object | The content of the item, which varies by content type. |
content_type | string | The type of content tracked in a project item (Issue, PullRequest, DraftIssue) (title: Projects v2 Item Content Type) |
created_at | string (date-time) | The time when the item was created. (example: 2022-04-28T12:00:00Z) |
creator | object | A GitHub user. (title: Simple User) |
fields | array | The fields and values associated with this item. |
item_url | string (uri) | The API URL of this item. (example: https://api.github.com/users/monalisa/2/projectsV2/items/3) |
project_url | string (uri) | The API URL of the project that contains this item. (example: https://api.github.com/users/monalisa/2/projectsV2/3) |
updated_at | string (date-time) | The time when the item was last updated. (example: 2022-04-28T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | number | The unique identifier of the project item. |
node_id | string | The node ID of the project item. |
archived_at | string (date-time) | The time when the item was archived. (example: 2022-04-28T12:00:00Z) |
content | object | The content of the item, which varies by content type. |
content_type | string | The type of content tracked in a project item (Issue, PullRequest, DraftIssue) (title: Projects v2 Item Content Type) |
created_at | string (date-time) | The time when the item was created. (example: 2022-04-28T12:00:00Z) |
creator | object | A GitHub user. (title: Simple User) |
fields | array | The fields and values associated with this item. |
item_url | string (uri) | The API URL of this item. (example: https://api.github.com/users/monalisa/2/projectsV2/items/3) |
project_url | string (uri) | The API URL of the project that contains this item. (example: https://api.github.com/users/monalisa/2/projectsV2/3) |
updated_at | string (date-time) | The time when the item was last updated. (example: 2022-04-28T12:00:00Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_view_items_for_org | select | project_number, org, view_number | fields, before, after, per_page | List items in an organization project with the saved view's filter applied. |
list_view_items_for_user | select | project_number, username, view_number | fields, before, after, per_page | List items in a user project with the saved view's filter applied. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
project_number | integer | The project's number. |
username | string | The handle for the GitHub user account. |
view_number | integer | The number that identifies the project view. |
after | string | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
before | string | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
fields | | Limit results to specific fields, by their IDs. If not specified, the title field will be returned. Example: fields[]=123&fields[]=456&fields[]=789 or fields=123,456,789 |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_view_items_for_org
- list_view_items_for_user
List items in an organization project with the saved view's filter applied.
SELECT
id,
node_id,
archived_at,
content,
content_type,
created_at,
creator,
fields,
item_url,
project_url,
updated_at
FROM github.projects.project_view_items
WHERE project_number = '{{ project_number }}' -- required
AND org = '{{ org }}' -- required
AND view_number = '{{ view_number }}' -- required
AND fields = '{{ fields }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
AND per_page = '{{ per_page }}'
;
List items in a user project with the saved view's filter applied.
SELECT
id,
node_id,
archived_at,
content,
content_type,
created_at,
creator,
fields,
item_url,
project_url,
updated_at
FROM github.projects.project_view_items
WHERE project_number = '{{ project_number }}' -- required
AND username = '{{ username }}' -- required
AND view_number = '{{ view_number }}' -- required
AND fields = '{{ fields }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
AND per_page = '{{ per_page }}'
;