Skip to content

Commit

Permalink
Merge pull request #450 from georgettica/georgettica/add-summary
Browse files Browse the repository at this point in the history
feat(create): allow setting summary
  • Loading branch information
georgettica authored Oct 27, 2022
2 parents f922fc7 + 10ad221 commit 4263bd2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jiracmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -91,6 +93,9 @@ func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptio
Overrides: opts.Overrides,
}
input.Overrides["project"] = opts.Project
if opts.Summary != "" {
input.Overrides["summary"] = opts.Summary
}
input.Overrides["issuetype"] = opts.IssueType
input.Overrides["login"] = globals.Login.Value

Expand Down

0 comments on commit 4263bd2

Please sign in to comment.