Skip to content

Commit 4263bd2

Browse files
authored
Merge pull request #450 from georgettica/georgettica/add-summary
feat(create): allow setting summary
2 parents f922fc7 + 10ad221 commit 4263bd2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jiracmd/create.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type CreateOptions struct {
1919
jiracli.CommonOptions `yaml:",inline" json:",inline" figtree:",inline"`
2020
jiradata.IssueUpdate `yaml:",inline" json:",inline" figtree:",inline"`
2121
Project string `yaml:"project,omitempty" json:"project,omitempty"`
22+
Summary string `yaml:"summary,omitempty" json:"summary`
2223
IssueType string `yaml:"issuetype,omitempty" json:"issuetype,omitempty"`
2324
Overrides map[string]string `yaml:"overrides,omitempty" json:"overrides,omitempty"`
2425
SaveFile string `yaml:"savefile,omitempty" json:"savefile,omitempty"`
@@ -51,6 +52,7 @@ func CmdCreateUsage(cmd *kingpin.CmdClause, opts *CreateOptions) error {
5152
jiracli.TemplateUsage(cmd, &opts.CommonOptions)
5253
cmd.Flag("noedit", "Disable opening the editor").SetValue(&opts.SkipEditing)
5354
cmd.Flag("project", "project to create issue in").Short('p').StringVar(&opts.Project)
55+
cmd.Flag("summary", "Summary of the issue").Short('s').StringVar(&opts.Summary)
5456
cmd.Flag("issuetype", "issuetype in to create").Short('i').StringVar(&opts.IssueType)
5557
cmd.Flag("comment", "Comment message for issue").Short('m').PreAction(func(ctx *kingpin.ParseContext) error {
5658
opts.Overrides["comment"] = jiracli.FlagValue(ctx, "comment")
@@ -91,6 +93,9 @@ func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptio
9193
Overrides: opts.Overrides,
9294
}
9395
input.Overrides["project"] = opts.Project
96+
if opts.Summary != "" {
97+
input.Overrides["summary"] = opts.Summary
98+
}
9499
input.Overrides["issuetype"] = opts.IssueType
95100
input.Overrides["login"] = globals.Login.Value
96101

0 commit comments

Comments
 (0)