cmdcommon

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cmdcommon contains methods common to multiple commands.

Index

Constants

View Source
const (
	// ActionSubmit is a submit action.
	ActionSubmit = "Submit"
	// ActionCancel is a cancel action.
	ActionCancel = "Cancel"
	// ActionMetadata is an add metadata action.
	ActionMetadata = "Add metadata"
)

Variables

This section is empty.

Functions

func GetConfiguredCustomFields

func GetConfiguredCustomFields() ([]jira.IssueTypeField, error)

GetConfiguredCustomFields returns the custom fields configured by the user.

func GetMetadata

func GetMetadata() []*survey.Question

GetMetadata gathers a list of metadata users wants to add.

func GetMetadataQuestions

func GetMetadataQuestions(cat []string) []*survey.Question

GetMetadataQuestions prepares metadata question to input from user.

func GetNextAction

func GetNextAction() *survey.Question

GetNextAction provide user an option to select next action.

func GetRelevantUser

func GetRelevantUser(client *jira.Client, project string, user string) string

GetRelevantUser finds and returns a valid user name or account ID based on user input.

func GetUserKeyForConfiguredInstallation

func GetUserKeyForConfiguredInstallation(user *jira.User) string

GetUserKeyForConfiguredInstallation returns either the user name or account ID based on jira installation type.

func HandleNoInput

func HandleNoInput(params *CreateParams) error

HandleNoInput handles operations for --no-input flag.

func SetCreateFlags

func SetCreateFlags(cmd *cobra.Command, prefix string)

SetCreateFlags sets flags supported by create command.

func ValidateCustomFields

func ValidateCustomFields(fields map[string]string, configuredFields []jira.IssueTypeField)

ValidateCustomFields validates custom fields. TODO: Fail with error instead of warning in future release.

Types

type CreateParams

type CreateParams struct {
	Name           string
	IssueType      string
	ParentIssueKey string
	Summary        string
	Body           string
	Priority       string
	Reporter       string
	Assignee       string
	Labels         []string
	Estimate       string
	Components     []string
	FixVersions    []string
	CustomFields   map[string]string
	Template       string
	NoInput        bool
	Debug          bool
}

CreateParams holds parameters for create command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL