Documentation ¶
Overview ¶
Package cmdcommon contains methods common to multiple commands.
Index ¶
- Constants
- func GetConfiguredCustomFields() ([]jira.IssueTypeField, error)
- func GetMetadata() []*survey.Question
- func GetMetadataQuestions(cat []string) []*survey.Question
- func GetNextAction() *survey.Question
- func GetRelevantUser(client *jira.Client, project string, user string) string
- func GetUserKeyForConfiguredInstallation(user *jira.User) string
- func HandleNoInput(params *CreateParams) error
- func SetCreateFlags(cmd *cobra.Command, prefix string)
- func ValidateCustomFields(fields map[string]string, configuredFields []jira.IssueTypeField)
- type CreateParams
Constants ¶
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
GetRelevantUser finds and returns a valid user name or account ID based on user input.
func GetUserKeyForConfiguredInstallation ¶ added in v1.3.0
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 ¶
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.