Skip to main content

issue_suggestions

Creates, updates, deletes, gets or lists an issue_suggestions resource.

Overview

Nameissue_suggestions
TypeResource
Idgithub.issues.issue_suggestions

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idintegerThe unique identifier of the suggestion.
actor_idintegerThe unique identifier of the actor that proposed the suggestion.
issue_event_idintegerThe identifier of the timeline event created when the suggestion was approved, when applicable.
issue_idintegerThe unique identifier of the issue the suggestion applies to.
target_idintegerThe identifier of the target the change applies to (issue type, label, field, assignee, or duplicate issue), when applicable.
actionstringThe kind of change proposed. (set_type, add_label, add_field, add_assignee, close_issue)
confidencestringThe actor's confidence level in the suggestion. (LOW, MEDIUM, HIGH)
created_atstring (date-time)The time the suggestion was created.
rationalestringThe rationale the actor provided for the suggestion.
resolved_byintegerThe unique identifier of the user who approved or dismissed the suggestion.
statestringThe suggestion's lifecycle state. (pending, applied, approved, dismissed, replaced, invalidated)
target_valuestringThe proposed value, when applicable. An array for multi-select field suggestions.
updated_atstring (date-time)The time the suggestion was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_suggestionsselectowner, repo, issue_numberstate, action, per_page, pageLists 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_suggestionexecowner, repo, issue_number, suggestion_idApproves 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_suggestionexecowner, repo, issue_number, suggestion_idDismisses 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.

NameDatatypeDescription
issue_numberintegerThe number that identifies the issue.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
suggestion_idintegerThe unique identifier of the suggestion.
actionstringFilter suggestions by the change they propose.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
statestringFilter suggestions by their state.

SELECT examples

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

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
;