Allow to clear the value of fields with `gh project item-edit` · Issue #7962 · cli/cli · GitHub
Skip to content

Allow to clear the value of fields with gh project item-edit  #7962

Description

@Toxaris

Describe the feature or problem you’d like to solve

We use the new github projects to keep track of custom fields. Some fields only make sense for some issue states. We would like to build automation based on gh to remove the field values when the issue state changes.

gh project item-edit already allows to set the field value (good) but it does not support removing the value of fields (bad, see #7910).

Proposed solution 1

Allow to pass an empty string to remove the value of the field:

gh project item-edit ... --number ''
gh project item-edit ... --single-select-option-id ''

Proposed solution 2

Support an explicit option to remove the value of the field:

gh project item-edit ... --clear

(I used to propose --empty but a comment below points out that the GraphQL interaction is called clear so that is a better name also for the CLI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-projectrelating to the gh project commandhelp wantedContributions welcomeproject

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions