jira

package
v0.0.0-...-cda3353 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JiraTimeLayout represents the layout used to parse the Jira time
	JiraTimeLayout = "2006-01-02T15:04:05.999-0700"

	// NoStoryPoints is a special value used when no story points were set
	NoStoryPoints int = -1
)
View Source
const (
	// DeliveryOwnerRegExp is the Regular Expression used to collect the Epic Delivery Owner
	DeliveryOwnerRegExp = `\W*(Delivery Owner|DELIVERY OWNER)\W*:\W*\[~([a-zA-Z0-9]*)\]`
)

Variables

View Source
var (
	// ErrAuthentication is returned when the authentication failed
	ErrAuthentication = errors.New("jira: access unauthorized")

	// ErrMultipleIssues is returned when multiple issues are found
	ErrMultipleIssues = errors.New("jira: unexpected multiple issues")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*jira.Client
	CustomFieldID struct {
		ParentLink  string
		EpicLink    string
		StoryPoints string
		AckFlags    string
		QEAssignee  string
		Acceptance  string
		Flagged     string
		Planning    string
		Readiness   string
		Commitment  string
		Design      string
	}
}

Client represents a Jira Client definition

func NewClient

func NewClient(url string, username, password *string) (*Client, error)

NewClient creates and returns a new Jira Client

func (*Client) FindEpics

func (c *Client) FindEpics(jql string) (IssueCollection, error)

FindEpics finds all the Jira Epics returned by the JQL search

func (*Client) FindIssues

func (c *Client) FindIssues(jql string) (IssueCollection, error)

FindIssues finds all the Jira Issues returned by the JQL search

func (*Client) FindProjectComponents

func (c *Client) FindProjectComponents(project string) ([]jira.ProjectComponent, error)

FindProjectComponents finds all the components in the specified project

type Comment

type Comment struct {
	*jira.Comment
	Created time.Time
	Updated time.Time
}

Comment represents Jira Issue Comment

type Issue

type Issue struct {
	jira.Issue
	Link          string
	ParentLink    string
	MarketProblem *Issue
	LinkedIssues  IssueCollection
	StoryPoints   int
	Readiness     IssueReadiness
	Planning      IssuePlanning
	Commitment    IssueCommitment
	Design        string
	QEAssignee    string
	Acceptance    string
	Owner         string
	Impediment    bool
	Comments      []*Comment
}

Issue represents a Jira Issue

func (*Issue) HasComponent

func (i *Issue) HasComponent(component string) bool

HasComponent returns true if the issue has the relevant component

func (*Issue) HasLabel

func (i *Issue) HasLabel(label string) bool

HasLabel returns true if the issue has the relevant label

func (*Issue) HasStoryPoints

func (i *Issue) HasStoryPoints() bool

HasStoryPoints returns true if the issue has story points defined

func (*Issue) InStatus

func (i *Issue) InStatus(status IssueStatus) bool

InStatus returns true if the issue is in the relevant status

func (*Issue) IsActive

func (i *Issue) IsActive() bool

IsActive returns true if the issue is currently worked on

func (*Issue) IsCommitted

func (i *Issue) IsCommitted() bool

IsCommitted returns true if the issue has committment from all stakeholders

func (*Issue) IsPrioritized

func (i *Issue) IsPrioritized() bool

IsPrioritized returns true if the issue Priority has been set

func (*Issue) IsResolved

func (i *Issue) IsResolved() bool

IsResolved returns true if the issue Resolution is Done

func (*Issue) IsType

func (i *Issue) IsType(tp IssueType) bool

IsType returns true if the issue is of the relevant type

func (*Issue) Ready

func (i *Issue) Ready() bool

Ready returns true if the issue is Ready-Ready

type IssueCollection

type IssueCollection []*Issue

IssueCollection is a collection of Jira Issues

func NewIssueCollection

func NewIssueCollection(size int) IssueCollection

NewIssueCollection creates and returns a new Jira Issue Collection

func (IssueCollection) AnyImpediment

func (c IssueCollection) AnyImpediment() bool

AnyImpediment returns if any of the issues has an impediment

func (IssueCollection) FilterByFunction

func (c IssueCollection) FilterByFunction(fn func(*Issue) bool) IssueCollection

FilterByFunction returns jira issues from collection that satisfy the provided function

func (IssueCollection) Progress

func (c IssueCollection) Progress() Progress

Progress returns the progress of the issues in the collection

func (IssueCollection) StoryPoints

func (c IssueCollection) StoryPoints() int

StoryPoints returns the total number of story points for the issues in the collection

func (IssueCollection) StoryPointsProgress

func (c IssueCollection) StoryPointsProgress() Progress

StoryPointsProgress returns the progress of the story points of the issues in the collection

type IssueCommitment

type IssueCommitment struct {
	Quality       bool
	Documentation bool
	Support       bool
}

IssueCommitment represents a Jira Issue Commitment

type IssuePlanning

type IssuePlanning struct {
	NoFeature       bool
	NoDocumentation bool
	NoQuality       bool
}

IssuePlanning represents a Jira Issue Planning

type IssuePriority

type IssuePriority string

IssuePriority represent an Issue Resolution

const (
	// IssuePriorityUnprioritized represents the Issue Priority Unprioritized
	IssuePriorityUnprioritized IssuePriority = "Unprioritized"
)

type IssueReadiness

type IssueReadiness struct {
	Development   bool
	Product       bool
	Quality       bool
	Experience    bool
	Documentation bool
	Support       bool
}

IssueReadiness represents a Jira Issue Approvals

type IssueResolution

type IssueResolution string

IssueResolution represent an Issue Resolution

const (
	// IssueResolutionDone represents the Issue Resolution Done
	IssueResolutionDone IssueResolution = "Done"
)

type IssueStatus

type IssueStatus string

IssueStatus represent an Issue Status

const (
	// IssueStatusDone represents the Issue Status Done
	IssueStatusDone IssueStatus = "Done"

	// IssueStatusObsolete represents the Issue Status Done
	IssueStatusObsolete IssueStatus = "Obsolete"

	// IssueStatusInProgress represents the Issue Status Done
	IssueStatusInProgress IssueStatus = "In Progress"

	// IssueStatusFeatureComplete represents the Issue Status Done
	IssueStatusFeatureComplete IssueStatus = "Feature Complete"

	// IssueStatusCodeReview represents the Issue Status Done
	IssueStatusCodeReview IssueStatus = "Code Review"

	// IssueStatusQEReview represents the Issue Status Done
	IssueStatusQEReview IssueStatus = "QE Review"
)

type IssueType

type IssueType string

IssueType represent an Issue Type

const (
	// IssueTypeInitiative represents the Issue Type Initiative
	IssueTypeInitiative IssueType = "Initiative"

	// IssueTypeEpic represents the Issue Type Epic
	IssueTypeEpic IssueType = "Epic"

	// IssueTypeStory represents the Issue Type Story
	IssueTypeStory IssueType = "Story"

	// IssueTypeTask represents the Issue Type Task
	IssueTypeTask IssueType = "Task"

	// IssueTypeBug represents the Issue Type Bug
	IssueTypeBug IssueType = "Bug"
)

type Progress

type Progress struct {
	Status  int
	Total   int
	Unknown int
}

Progress represent the progress in a series of activities

func (*Progress) Percentage

func (p *Progress) Percentage() float64

Percentage returns the percentage of the progress

func (*Progress) Remaining

func (p *Progress) Remaining() int

Remaining returns the number of items remaining

Jump to

Keyboard shortcuts

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