issue_suggestions
Creates, updates, deletes, gets or lists an issue_suggestions resource.
Overview
| Name | issue_suggestions |
| Type | Resource |
| Id | github.issues.issue_suggestions |
Fields
The following fields are returned by SELECT queries:
- list_suggestions
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the suggestion. |
actor_id | integer | The unique identifier of the actor that proposed the suggestion. |
issue_event_id | integer | The identifier of the timeline event created when the suggestion was approved, when applicable. |
issue_id | integer | The unique identifier of the issue the suggestion applies to. |
target_id | integer | The identifier of the target the change applies to (issue type, label, field, assignee, or duplicate issue), when applicable. |
action | string | The kind of change proposed. (set_type, add_label, add_field, add_assignee, close_issue) |
confidence | string | The actor's confidence level in the suggestion. (LOW, MEDIUM, HIGH) |
created_at | string (date-time) | The time the suggestion was created. |
rationale | string | The rationale the actor provided for the suggestion. |
resolved_by | integer | The unique identifier of the user who approved or dismissed the suggestion. |
state | string | The suggestion's lifecycle state. (pending, applied, approved, dismissed, replaced, invalidated) |
target_value | string | The proposed value, when applicable. An array for multi-select field suggestions. |
updated_at | string (date-time) | The time the suggestion was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_suggestions | select | owner, repo, issue_number | state, action, per_page, page | Lists the suggestions on an issue. A suggestion is an agent-proposed change to an issue's type, labels, fields, assignees, or closed state that a maintainer can approve or dismiss. By default only pending suggestions are returned. Use state=all to return suggestions in every state, or state=<state> to filter to a single state. Use action=<action> to return only suggestions for a specific change.This endpoint is only available while the issue suggestions feature is enabled for the repository, and only supports issues, not pull requests. Requires triage access to the repository. |
approve_suggestion | exec | owner, repo, issue_number, suggestion_id | Approves a pending suggestion on an issue. Applies the proposed change (creating the corresponding timeline event), transitions the suggestion to approved, and dismisses any competing pending suggestions for the same change.Requires triage access to the repository. Approving a suggestion also requires permission to perform the change it applies (for example, setting the issue type, adding a label or assignee, or closing the issue); this only affects fine-grained access tokens and GitHub Apps whose permissions are narrower than the triage role. This endpoint only supports issues, not pull requests. | |
dismiss_suggestion | exec | owner, repo, issue_number, suggestion_id | Dismisses a pending suggestion on an issue. Transitions the suggestion to dismissed without applying any change or creating a timeline event.Requires triage access to the repository. This endpoint only supports issues, not pull requests. |
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 |
|---|---|---|
issue_number | integer | The number that identifies the issue. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
suggestion_id | integer | The unique identifier of the suggestion. |
action | string | Filter suggestions by the change they propose. |
page | integer | The page number of the results to fetch. 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." |
state | string | Filter suggestions by their state. |
SELECT examples
- list_suggestions
Lists the suggestions on an issue. A suggestion is an agent-proposed change to an issue's type, labels, fields, assignees, or closed state that a maintainer can approve or dismiss.
By default only pending suggestions are returned. Use state=all to return suggestions in every state, or state=<state> to filter to a single state. Use action=<action> to return only suggestions for a specific change.
This endpoint is only available while the issue suggestions feature is enabled for the repository, and only supports issues, not pull requests.
Requires triage access to the repository.
SELECT
id,
actor_id,
issue_event_id,
issue_id,
target_id,
action,
confidence,
created_at,
rationale,
resolved_by,
state,
target_value,
updated_at
FROM github.issues.issue_suggestions
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND issue_number = '{{ issue_number }}' -- required
AND state = '{{ state }}'
AND action = '{{ action }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lifecycle Methods
- approve_suggestion
- dismiss_suggestion
Approves a pending suggestion on an issue. Applies the proposed change (creating the corresponding timeline event), transitions the suggestion to approved, and dismisses any competing pending suggestions for the same change.
Requires triage access to the repository. Approving a suggestion also requires permission to perform the change it applies (for example, setting the issue type, adding a label or assignee, or closing the issue); this only affects fine-grained access tokens and GitHub Apps whose permissions are narrower than the triage role. This endpoint only supports issues, not pull requests.
EXEC github.issues.issue_suggestions.approve_suggestion
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@issue_number='{{ issue_number }}' --required,
@suggestion_id='{{ suggestion_id }}' --required
;
Dismisses a pending suggestion on an issue. Transitions the suggestion to dismissed without applying any change or creating a timeline event.
Requires triage access to the repository. This endpoint only supports issues, not pull requests.
EXEC github.issues.issue_suggestions.dismiss_suggestion
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@issue_number='{{ issue_number }}' --required,
@suggestion_id='{{ suggestion_id }}' --required
;