-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
enhancementa request to improve CLIa request to improve CLIgh-projectrelating to the gh project commandrelating to the gh project commandhelp wantedContributions welcomeContributions welcome
Description
Describe the feature or problem you’d like to solve
To use gh project item-edit on a draft issue to edit the title or body, you need the draft issue content ID, but the output of gh project item-list does not include that ID, so it's difficult to edit draft issues from the CLI.
Proposed solution
There should be an id field under content when outputting JSON for gh project item-list so that users can get the ID they need to edit the draft issue.
Alternatively gh project item-edit could be updated to do an additional query to try to convert an ID with prefix PVTI_ to DI_ and failing if it's not a draft issue.
Additional context
Relevant code section about requiring the draft issue ID to edit title or body:
cli/pkg/cmd/project/item-edit/item_edit.go
Lines 118 to 136 in 53c36d0
| // update draft issue | |
| if config.opts.title != "" || config.opts.body != "" { | |
| if !strings.HasPrefix(config.opts.itemID, "DI_") { | |
| return cmdutil.FlagErrorf("ID must be the ID of the draft issue content which is prefixed with `DI_`") | |
| } | |
| query, variables := buildEditDraftIssue(config) | |
| err := config.client.Mutate("EditDraftIssueItem", query, variables) | |
| if err != nil { | |
| return err | |
| } | |
| if config.opts.format == "json" { | |
| return printDraftIssueJSON(config, query.UpdateProjectV2DraftIssue.DraftIssue) | |
| } | |
| return printDraftIssueResults(config, query.UpdateProjectV2DraftIssue.DraftIssue) | |
| } |
ObserverOfTime
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIgh-projectrelating to the gh project commandrelating to the gh project commandhelp wantedContributions welcomeContributions welcome