utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RegexQuotes contains quotes to be replaced by regex which are sent via Slack
	RegexQuotes = "([“”])"
)

Variables

This section is empty.

Functions

func BuildAttachmentTicket

func BuildAttachmentTicket(replies config.ReplyConfig, config config.JiraConfig, issue *jira.Issue) slack.Attachment

BuildAttachmentTicket creates a Slack Attachment with JIRA ticket information

func ParseRegex

func ParseRegex(text string, regex string) string

ParseRegex replaces text by a specified regex and fixes Slack quotes

Types

type JQL

type JQL struct {
	Project     string
	Type        string
	Priority    string
	Status      string
	Option      string
	Time        string
	OffsetTime  string
	OffsetField string
	Custom      string
	Assignee    string
	Sorting     string
}

JQL is a wrapper with all information for a JIRA JQL

func NewJQL

func NewJQL(config config.RegexConfig, input string) *JQL

NewJQL provides all information needed for a JIRA JQL

func (*JQL) BuildJqlQuery

func (jql *JQL) BuildJqlQuery(config config.JiraConfig) (string, error)

BuildJqlQuery creates a JIRA JQL based on the given information

type Layout

type Layout struct {
	Option   string
	Project  string
	Assignee string
	Title    string
	Color    string
	List     string
}

Layout is a wrapper for layouting the Slack replies

func NewLayout

func NewLayout(config config.RegexConfig, input string) *Layout

NewLayout holds all information for layouting a Slack reply

func (*Layout) BuildAttachment

func (layout *Layout) BuildAttachment(replies config.ReplyConfig, config config.JiraConfig, amount int, issues []jira.Issue) slack.Attachment

BuildAttachment creates Slack Attachments for Slack replies

func (*Layout) BuildSimpleTextResponse added in v1.2.0

func (layout *Layout) BuildSimpleTextResponse(config config.JiraConfig, issue jira.Issue, customFields jira.CustomFields, allFields []jira.Field, jql *JQL) string

Jump to

Keyboard shortcuts

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