mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
6a27e28c61
this commit deprecates the searching ability by username and instructs user to provide email or display names in commands. the username parameter has been deprecated completely from v2 and v3 api Signed-off-by: ldelossa <ldelossa@redhat.com>
34 lines
903 B
Go
34 lines
903 B
Go
package jiracmd
|
|
|
|
import (
|
|
"github.com/coryb/figtree"
|
|
"github.com/coryb/oreo"
|
|
"github.com/go-jira/jira/jiracli"
|
|
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
|
)
|
|
|
|
func CmdTakeRegistry() *jiracli.CommandRegistryEntry {
|
|
opts := AssignOptions{}
|
|
|
|
return &jiracli.CommandRegistryEntry{
|
|
"Assign issue to yourself",
|
|
func(fig *figtree.FigTree, cmd *kingpin.CmdClause) error {
|
|
jiracli.LoadConfigs(cmd, fig, &opts)
|
|
return CmdAssignUsage(cmd, &opts)
|
|
},
|
|
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
|
|
opts.Issue = jiracli.FormatIssue(opts.Issue, opts.Project)
|
|
if opts.Assignee == "" {
|
|
opts.Assignee = globals.Login.Value
|
|
}
|
|
return CmdAssign(o, globals, &opts)
|
|
},
|
|
}
|
|
}
|
|
|
|
func CmdTakeUsage(cmd *kingpin.CmdClause, opts *AssignOptions) error {
|
|
jiracli.BrowseUsage(cmd, &opts.CommonOptions)
|
|
cmd.Arg("ISSUE", "issue to assign").Required().StringVar(&opts.Issue)
|
|
return nil
|
|
}
|