From 6e90b2000ab17e6cc4591d51c9e37d2cebd3aa71 Mon Sep 17 00:00:00 2001 From: Ron Green <11993626+georgettica@users.noreply.github.com> Date: Sun, 5 Dec 2021 15:52:42 +0200 Subject: [PATCH 1/2] feat(create): allow setting summary shamelessly taken from his fork a part of me going through all of the forks and pulling all of the useful info out Co-authored-by: Ben Cordero --- jiracmd/create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jiracmd/create.go b/jiracmd/create.go index 3abc884a..51f9f245 100644 --- a/jiracmd/create.go +++ b/jiracmd/create.go @@ -19,6 +19,7 @@ type CreateOptions struct { jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"` jiradata.IssueUpdate `yaml:",inline" json:",inline" figtree:",inline"` Project string `yaml:"project,omitempty" json:"project,omitempty"` + Summary string `yaml:"summary,omitempty" json:"summary` IssueType string `yaml:"issuetype,omitempty" json:"issuetype,omitempty"` Overrides map[string]string `yaml:"overrides,omitempty" json:"overrides,omitempty"` SaveFile string `yaml:"savefile,omitempty" json:"savefile,omitempty"` @@ -51,6 +52,7 @@ func CmdCreateUsage(cmd *kingpin.CmdClause, opts *CreateOptions) error { jiracli.TemplateUsage(cmd, &opts.CommonOptions) cmd.Flag("noedit", "Disable opening the editor").SetValue(&opts.SkipEditing) cmd.Flag("project", "project to create issue in").Short('p').StringVar(&opts.Project) + cmd.Flag("summary", "Summary of the issue").Short('s').StringVar(&opts.Summary) cmd.Flag("issuetype", "issuetype in to create").Short('i').StringVar(&opts.IssueType) cmd.Flag("comment", "Comment message for issue").Short('m').PreAction(func(ctx *kingpin.ParseContext) error { opts.Overrides["comment"] = jiracli.FlagValue(ctx, "comment") @@ -91,6 +93,7 @@ func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptio Overrides: opts.Overrides, } input.Overrides["project"] = opts.Project + input.Overrides["summary"] = opts.Summary input.Overrides["issuetype"] = opts.IssueType input.Overrides["login"] = globals.Login.Value From 10ad221ce45c485a38e3179b28607940f0a1602f Mon Sep 17 00:00:00 2001 From: Ron Green <11993626+georgettica@users.noreply.github.com> Date: Sun, 5 Dec 2021 18:00:31 +0200 Subject: [PATCH 2/2] attempt to make tests pass --- jiracmd/create.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jiracmd/create.go b/jiracmd/create.go index 51f9f245..3888b47b 100644 --- a/jiracmd/create.go +++ b/jiracmd/create.go @@ -93,7 +93,9 @@ func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptio Overrides: opts.Overrides, } input.Overrides["project"] = opts.Project - input.Overrides["summary"] = opts.Summary + if opts.Summary != "" { + input.Overrides["summary"] = opts.Summary + } input.Overrides["issuetype"] = opts.IssueType input.Overrides["login"] = globals.Login.Value