jira

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 13 Imported by: 1

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) CloseIssue added in v3.2.0

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

func (*Integration) CreateIssue

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

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

func (*Integration) CreateNewIssue

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

CreateNewIssue creates a new issue in the tracker

func (*Integration) FindExistingIssue

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

FindExistingIssue checks if the issue already exists and returns its ID

func (*Integration) Name added in v3.2.0

func (i *Integration) Name() string

func (*Integration) ShouldFilter added in v3.2.0

func (i *Integration) ShouldFilter(event *output.ResultEvent) bool

ShouldFilter determines if an issue should be logged to this tracker

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"`
	// AllowList contains a list of allowed events for this tracker
	AllowList *filters.Filter `yaml:"allow-list"`
	// DenyList contains a list of denied events for this tracker
	DenyList *filters.Filter `yaml:"deny-list"`
	// 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"`
	OmitRaw      bool                   `yaml:"-"`
}

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