cmdcommon

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	Components       []string
	FixVersions      []string
	AffectsVersions  []string
	OriginalEstimate 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