cmdcommon

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 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 added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

func GetUserKeyForConfiguredInstallation(user *jira.User) string

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

func HandleNoInput added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

type CreateParams struct {
	Name            string
	IssueType       string
	ParentIssueKey  string
	Summary         string
	Body            string
	Priority        string
	Reporter        string
	Assignee        string
	Labels          []string
	Components      []string
	FixVersions     []string
	AffectsVersions []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