project_fields
Creates, updates, deletes, gets or lists a project_fields resource.
Overview
| Name | project_fields |
| Type | Resource |
| Id | github.projects.project_fields |
Fields
The following fields are returned by SELECT queries:
- get_field_for_org
- get_field_for_user
- list_fields_for_org
- list_fields_for_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the field. |
name | string | The name of the field. |
issue_field_id | integer | The ID of the issue field. |
node_id | string | The node ID of the field. |
configuration | object | Configuration for iteration fields. |
created_at | string (date-time) | The time when the field was created. (example: 2022-04-28T12:00:00Z) |
data_type | string | The field's data type. (assignees, linked_pull_requests, reviewers, labels, milestone, repository, title, text, single_select, number, date, iteration, issue_type, parent_issue, sub_issues_progress) |
options | array | The options available for single select fields. |
project_url | string | The API URL of the project that contains the field. (example: https://api.github.com/projects/1) |
updated_at | string (date-time) | The time when the field was last updated. (example: 2022-04-28T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the field. |
name | string | The name of the field. |
issue_field_id | integer | The ID of the issue field. |
node_id | string | The node ID of the field. |
configuration | object | Configuration for iteration fields. |
created_at | string (date-time) | The time when the field was created. (example: 2022-04-28T12:00:00Z) |
data_type | string | The field's data type. (assignees, linked_pull_requests, reviewers, labels, milestone, repository, title, text, single_select, number, date, iteration, issue_type, parent_issue, sub_issues_progress) |
options | array | The options available for single select fields. |
project_url | string | The API URL of the project that contains the field. (example: https://api.github.com/projects/1) |
updated_at | string (date-time) | The time when the field was last updated. (example: 2022-04-28T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the field. |
name | string | The name of the field. |
issue_field_id | integer | The ID of the issue field. |
node_id | string | The node ID of the field. |
configuration | object | Configuration for iteration fields. |
created_at | string (date-time) | The time when the field was created. (example: 2022-04-28T12:00:00Z) |
data_type | string | The field's data type. (assignees, linked_pull_requests, reviewers, labels, milestone, repository, title, text, single_select, number, date, iteration, issue_type, parent_issue, sub_issues_progress) |
options | array | The options available for single select fields. |
project_url | string | The API URL of the project that contains the field. (example: https://api.github.com/projects/1) |
updated_at | string (date-time) | The time when the field was last updated. (example: 2022-04-28T12:00:00Z) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the field. |
name | string | The name of the field. |
issue_field_id | integer | The ID of the issue field. |
node_id | string | The node ID of the field. |
configuration | object | Configuration for iteration fields. |
created_at | string (date-time) | The time when the field was created. (example: 2022-04-28T12:00:00Z) |
data_type | string | The field's data type. (assignees, linked_pull_requests, reviewers, labels, milestone, repository, title, text, single_select, number, date, iteration, issue_type, parent_issue, sub_issues_progress) |
options | array | The options available for single select fields. |
project_url | string | The API URL of the project that contains the field. (example: https://api.github.com/projects/1) |
updated_at | string (date-time) | The time when the field 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 |
|---|---|---|---|---|
get_field_for_org | select | project_number, field_id, org | Get a specific field for an organization-owned project. | |
get_field_for_user | select | project_number, field_id, username | Get a specific field for a user-owned project. | |
list_fields_for_org | select | project_number, org | per_page, before, after | List all fields for a specific organization-owned project. |
list_fields_for_user | select | project_number, username | per_page, before, after | List all fields for a specific user-owned project. |
add_field_for_org | insert | project_number, org, issue_field_id, name, data_type, single_select_options, iteration_configuration | Add a field to an organization-owned project. | |
add_field_for_user | insert | username, project_number, name, data_type, single_select_options, iteration_configuration | Add a field to a specified user owned project. |
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 |
|---|---|---|
field_id | integer | The unique identifier of the field. |
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. |
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." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_field_for_org
- get_field_for_user
- list_fields_for_org
- list_fields_for_user
Get a specific field for an organization-owned project.
SELECT
id,
name,
issue_field_id,
node_id,
configuration,
created_at,
data_type,
options,
project_url,
updated_at
FROM github.projects.project_fields
WHERE project_number = '{{ project_number }}' -- required
AND field_id = '{{ field_id }}' -- required
AND org = '{{ org }}' -- required
;
Get a specific field for a user-owned project.
SELECT
id,
name,
issue_field_id,
node_id,
configuration,
created_at,
data_type,
options,
project_url,
updated_at
FROM github.projects.project_fields
WHERE project_number = '{{ project_number }}' -- required
AND field_id = '{{ field_id }}' -- required
AND username = '{{ username }}' -- required
;
List all fields for a specific organization-owned project.
SELECT
id,
name,
issue_field_id,
node_id,
configuration,
created_at,
data_type,
options,
project_url,
updated_at
FROM github.projects.project_fields
WHERE project_number = '{{ project_number }}' -- required
AND org = '{{ org }}' -- required
AND per_page = '{{ per_page }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
;
List all fields for a specific user-owned project.
SELECT
id,
name,
issue_field_id,
node_id,
configuration,
created_at,
data_type,
options,
project_url,
updated_at
FROM github.projects.project_fields
WHERE project_number = '{{ project_number }}' -- required
AND username = '{{ username }}' -- required
AND per_page = '{{ per_page }}'
AND before = '{{ before }}'
AND after = '{{ after }}'
;
INSERT examples
- add_field_for_org
- add_field_for_user
- Manifest
Add a field to an organization-owned project.
INSERT INTO github.projects.project_fields (
issue_field_id,
name,
data_type,
single_select_options,
iteration_configuration,
project_number,
org
)
SELECT
{{ issue_field_id }} /* required */,
'{{ name }}' /* required */,
'{{ data_type }}' /* required */,
'{{ single_select_options }}' /* required */,
'{{ iteration_configuration }}' /* required */,
'{{ project_number }}',
'{{ org }}'
RETURNING
id,
name,
issue_field_id,
node_id,
configuration,
created_at,
data_type,
options,
project_url,
updated_at
;
Add a field to a specified user owned project.
INSERT INTO github.projects.project_fields (
name,
data_type,
single_select_options,
iteration_configuration,
username,
project_number
)
SELECT
'{{ name }}' /* required */,
'{{ data_type }}' /* required */,
'{{ single_select_options }}' /* required */,
'{{ iteration_configuration }}' /* required */,
'{{ username }}',
'{{ project_number }}'
RETURNING
id,
name,
issue_field_id,
node_id,
configuration,
created_at,
data_type,
options,
project_url,
updated_at
;
# Description fields are for documentation purposes
- name: project_fields
props:
- name: project_number
value: {{ project_number }}
description: Required parameter for the project_fields resource.
- name: org
value: "{{ org }}"
description: Required parameter for the project_fields resource.
- name: username
value: "{{ username }}"
description: Required parameter for the project_fields resource.
- name: issue_field_id
value: {{ issue_field_id }}
description: |
The ID of the IssueField to create the field for.
- name: name
value: "{{ name }}"
description: |
The name of the field.
- name: data_type
value: "{{ data_type }}"
description: |
The field's data type.
valid_values: ['text', 'number', 'date']
- name: single_select_options
description: |
The options available for single select fields. At least one option must be provided when creating a single select field.
value:
- name: "{{ name }}"
color: "{{ color }}"
description: "{{ description }}"
- name: iteration_configuration
description: |
The configuration for iteration fields.
value:
start_date: "{{ start_date }}"
duration: {{ duration }}
iterations:
- title: "{{ title }}"
start_date: "{{ start_date }}"
duration: {{ duration }}