custom_properties
Creates, updates, deletes, gets or lists a custom_properties resource.
Overview
| Name | custom_properties |
| Type | Resource |
| Id | github.orgs.custom_properties |
Fields
The following fields are returned by SELECT queries:
- custom_properties_for_repos_get_organization_definition
- custom_properties_for_repos_get_organization_definitions
Response
| Name | Datatype | Description |
|---|---|---|
property_name | string | The name of the property |
allowed_values | array | An ordered list of the allowed values of the property. The property can have up to 200 allowed values. |
default_value | string | Default value of the property |
description | string | Short description of the property |
require_explicit_values | boolean | Whether setting properties values is mandatory |
required | boolean | Whether the property is required. |
source_type | string | The source type of the property (organization, enterprise) (example: organization) |
url | string (uri) | The URL that can be used to fetch, update, or delete info about this property via the API. |
value_type | string | The type of the value for the property (string, single_select, multi_select, true_false, url) (example: single_select) |
values_editable_by | string | Who can edit the values of the property (org_actors, org_and_repo_actors) (example: org_actors) |
Response
| Name | Datatype | Description |
|---|---|---|
property_name | string | The name of the property |
allowed_values | array | An ordered list of the allowed values of the property. The property can have up to 200 allowed values. |
default_value | string | Default value of the property |
description | string | Short description of the property |
require_explicit_values | boolean | Whether setting properties values is mandatory |
required | boolean | Whether the property is required. |
source_type | string | The source type of the property (organization, enterprise) (example: organization) |
url | string (uri) | The URL that can be used to fetch, update, or delete info about this property via the API. |
value_type | string | The type of the value for the property (string, single_select, multi_select, true_false, url) (example: single_select) |
values_editable_by | string | Who can edit the values of the property (org_actors, org_and_repo_actors) (example: org_actors) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
custom_properties_for_repos_get_organization_definition | select | org, custom_property_name | Gets a custom property that is defined for an organization. Organization members can read these properties. | |
custom_properties_for_repos_get_organization_definitions | select | org | Gets all custom properties defined for an organization. Organization members can read these properties. | |
custom_properties_for_repos_create_or_update_organization_definitions | update | org, properties | Creates new or updates existing custom properties defined for an organization in a batch. If the property already exists, the existing property will be replaced with the new values. Missing optional values will fall back to default values, previous values will be overwritten. E.g. if a property exists with values_editable_by: org_and_repo_actors and it's updated without specifying values_editable_by, it will be updated to default value org_actors.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of custom_properties_org_definitions_manager in the organization. | |
custom_properties_for_repos_create_or_update_organization_definition | replace | org, custom_property_name, value_type | Creates a new or updates an existing custom property that is defined for an organization. To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of custom_properties_org_definitions_manager in the organization. | |
custom_properties_for_repos_delete_organization_definition | delete | org, custom_property_name | Removes a custom property that is defined for an organization. To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of custom_properties_org_definitions_manager in the organization. |
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 |
|---|---|---|
custom_property_name | string | The custom property name |
org | string | The organization name. The name is not case sensitive. |
SELECT examples
- custom_properties_for_repos_get_organization_definition
- custom_properties_for_repos_get_organization_definitions
Gets a custom property that is defined for an organization.
Organization members can read these properties.
SELECT
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by
FROM github.orgs.custom_properties
WHERE org = '{{ org }}' -- required
AND custom_property_name = '{{ custom_property_name }}' -- required
;
Gets all custom properties defined for an organization.
Organization members can read these properties.
SELECT
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by
FROM github.orgs.custom_properties
WHERE org = '{{ org }}' -- required
;
UPDATE examples
- custom_properties_for_repos_create_or_update_organization_definitions
Creates new or updates existing custom properties defined for an organization in a batch.
If the property already exists, the existing property will be replaced with the new values.
Missing optional values will fall back to default values, previous values will be overwritten.
E.g. if a property exists with values_editable_by: org_and_repo_actors and it's updated without specifying values_editable_by, it will be updated to default value org_actors.
To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permission of custom_properties_org_definitions_manager in the organization.
UPDATE github.orgs.custom_properties
SET
properties = '{{ properties }}'
WHERE
org = '{{ org }}' --required
AND properties = '{{ properties }}' --required
RETURNING
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by;
REPLACE examples
- custom_properties_for_repos_create_or_update_organization_definition
Creates a new or updates an existing custom property that is defined for an organization.
To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permission of custom_properties_org_definitions_manager in the organization.
REPLACE github.orgs.custom_properties
SET
value_type = '{{ value_type }}',
required = {{ required }},
default_value = '{{ default_value }}',
description = '{{ description }}',
allowed_values = '{{ allowed_values }}',
values_editable_by = '{{ values_editable_by }}',
require_explicit_values = {{ require_explicit_values }}
WHERE
org = '{{ org }}' --required
AND custom_property_name = '{{ custom_property_name }}' --required
AND value_type = '{{ value_type }}' --required
RETURNING
property_name,
allowed_values,
default_value,
description,
require_explicit_values,
required,
source_type,
url,
value_type,
values_editable_by;
DELETE examples
- custom_properties_for_repos_delete_organization_definition
Removes a custom property that is defined for an organization.
To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permission of custom_properties_org_definitions_manager in the organization.
DELETE FROM github.orgs.custom_properties
WHERE org = '{{ org }}' --required
AND custom_property_name = '{{ custom_property_name }}' --required
;