Skip to content

Commit

Permalink
Use Jira user search endpoint to get account IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
berlam committed Oct 4, 2019
1 parent 617eca4 commit 1306d34
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 112 deletions.
13 changes: 10 additions & 3 deletions cmd/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ var showCmd = &cobra.Command{
if internal.Config.Projects != nil && internal.Config.PrintEmptyLine {
return fmt.Errorf("empty lines (--%s) are not available for projects (--%s)", internal.FlagPrintEmptyLine, internal.FlagProjects)
}
if internal.Config.Projects != nil && len(internal.Config.Projects) > 1 {
return fmt.Errorf("only one project allowed")
}
return nil
},
}
Expand All @@ -57,6 +54,16 @@ var showBcsCmd = &cobra.Command{
Short: "Show worklog from BCS",
Long: "Show your worklog data from Projektron BCS.",
Args: cobra.NoArgs,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
err := cmd.Parent().PersistentPreRunE(cmd, args)
if err != nil {
return err
}
if internal.Config.Projects != nil && len(internal.Config.Projects) > 1 {
return fmt.Errorf("only one project allowed")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) {
if internal.Config.Projects == nil {
bcs.GetTimesheet(
Expand Down
Loading

0 comments on commit 1306d34

Please sign in to comment.