jira

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	util.MarkdownFormatter
}

func (*Formatter) CreateCodeBlock

func (jiraFormatter *Formatter) CreateCodeBlock(title string, content string, _ string) string
func (jiraFormatter *Formatter) CreateLink(title string, url string) string

func (*Formatter) CreateTable

func (jiraFormatter *Formatter) CreateTable(headers []string, rows [][]string) (string, error)

func (*Formatter) MakeBold

func (jiraFormatter *Formatter) MakeBold(text string) string

type Integration

type Integration struct {
	Formatter
	// contains filtered or unexported fields
}

Integration is a client for an issue tracker integration

func New

func New(options *Options) (*Integration, error)

New creates a new issue tracker integration client based on options.

func (*Integration) CreateIssue

func (i *Integration) CreateIssue(event *output.ResultEvent) error

CreateIssue creates an issue in the tracker or updates the existing one

func (*Integration) CreateNewIssue

func (i *Integration) CreateNewIssue(event *output.ResultEvent) error

CreateNewIssue creates a new issue in the tracker

func (*Integration) FindExistingIssue

func (i *Integration) FindExistingIssue(event *output.ResultEvent) (string, error)

FindExistingIssue checks if the issue already exists and returns its ID

type Options

type Options struct {
	// Cloud value (optional) is set to true when Jira cloud is used
	Cloud bool `yaml:"cloud" json:"cloud"`
	// UpdateExisting value (optional) if true, the existing opened issue is updated
	UpdateExisting bool `yaml:"update-existing" json:"update_existing"`
	// URL is the URL of the jira server
	URL string `yaml:"url" json:"url" validate:"required"`
	// AccountID is the accountID of the jira user.
	AccountID string `yaml:"account-id" json:"account_id" validate:"required"`
	// Email is the email of the user for jira instance
	Email string `yaml:"email" json:"email" validate:"required,email"`
	// Token is the token for jira instance.
	Token string `yaml:"token" json:"token" validate:"required"`
	// ProjectName is the name of the project.
	ProjectName string `yaml:"project-name" json:"project_name" validate:"required"`
	// IssueType (optional) is the name of the created issue type
	IssueType string `yaml:"issue-type" json:"issue_type"`
	// SeverityAsLabel (optional) sends the severity as the label of the created
	// issue.
	SeverityAsLabel bool `yaml:"severity-as-label" json:"severity_as_label"`
	// Severity (optional) is the severity of the issue.
	Severity   []string              `yaml:"severity" json:"severity"`
	HttpClient *retryablehttp.Client `yaml:"-" json:"-"`
	// for each customfield specified in the configuration options
	// we will create a map of customfield name to the value
	// that will be used to create the issue
	CustomFields map[string]interface{} `yaml:"custom-fields" json:"custom_fields"`
	StatusNot    string                 `yaml:"status-not" json:"status_not"`
}

Options contains the configuration options for jira client

Jump to

Keyboard shortcuts

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