jiraxml

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DMYDateFormat = "_2-01-2006"

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Version     string        `xml:"version"`
	BuildNumber int64         `xml:"build-number"`
	BuildDate   DMYDateString `xml:"build-date"`
}

type Channel

type Channel struct {
	Title       string    `xml:"title"`
	Link        string    `xml:"link"`
	Description string    `xml:"description"`
	Language    string    `xml:"language"`
	BuildInfo   BuildInfo `xml:"build-info"`
	Issues      Issues    `xml:"item"`
}

type DMYDateString

type DMYDateString string

func (DMYDateString) Time

func (s DMYDateString) Time() (time.Time, error)

type Duration

type Duration struct {
	Display string `xml:",chardata"`
	Seconds int64  `xml:"seconds,attr"`
}

func (*Duration) Days

func (d *Duration) Days(workingHoursPerDay float32) float32

func (*Duration) Duration

func (d *Duration) Duration() time.Duration

func (*Duration) TrimSpace

func (d *Duration) TrimSpace()

type Issue

type Issue struct {
	Type                           Simple         `xml:"type"`
	Title                          string         `xml:"title"`
	Assignee                       User           `xml:"assignee"`
	Description                    string         `xml:"description"`
	FixVersion                     string         `xml:"fixVersion"`
	Link                           string         `xml:"link"`
	Key                            Simple         `xml:"key"`
	Project                        Project        `xml:"project"`
	Reporter                       User           `xml:"reporter"`
	Resolution                     Simple         `xml:"resolution"`
	Status                         Status         `xml:"status"`
	Summary                        string         `xml:"summary"`
	TimeEstimate                   Duration       `xml:"timeestimate"`
	TimeOriginalEstimate           Duration       `xml:"timeoriginalestimate"`
	TimeSpent                      Duration       `xml:"timespent"`
	AggregateTimeEstimate          Duration       `xml:"aggregatetimeestimate"`
	AggregateTimeOriginalEstimate  Duration       `xml:"aggregatetimeoriginalestimate"`
	AggregateTimeRemainingEstimate Duration       `xml:"aggregatetimeremainingestimate"`
	AggregateTimeSpent             Duration       `xml:"aggregatetimespent"`
	Labels                         []Label        `xml:"labels"`
	Created                        RFC1123ZString `xml:"created"`  // RFC1123Z
	Updated                        RFC1123ZString `xml:"updated"`  // RFC1123Z
	Resolved                       RFC1123ZString `xml:"resolved"` // RFC1123Z
	Votes                          int            `json:"votes"`
	Watches                        int            `json:"watches"`
}

func IssueFromAPI

func IssueFromAPI(iss jira.Issue) Issue

func (*Issue) GetKey

func (i *Issue) GetKey() string

func (*Issue) TrimSpace

func (i *Issue) TrimSpace()

TrimSpace removes leading and trailing space. It is useful when parsing XML that has been modified, such as by VS Code extensions.

type Issues

type Issues []Issue

func (Issues) FilterByStatus

func (ii Issues) FilterByStatus(statuses ...string) Issues

func (Issues) Keys

func (ii Issues) Keys() []string

func (Issues) Stats

func (ii Issues) Stats(workingHoursPerDay, workingDaysPerWeek float32) gojira.IssuesStats

func (Issues) TSRHistogramSets

func (ii Issues) TSRHistogramSets(name string) *histogram.HistogramSets

TSRHistogramSets returns a `*histogram.HistogramSets` for Type, Status and Resolution.

func (Issues) TSRTable

func (ii Issues) TSRTable(name string) table.Table

TSRTable returns a `table.Table` for Type, Status and Resolution.

func (Issues) TSRWriteCSV

func (ii Issues) TSRWriteCSV(filename string) error

TSRWriteCSV writes a CSV file for Type, Status and Resolution.

type IssuesSet

type IssuesSet struct {
	Config    *gojira.Config
	IssuesMap map[string]Issue
}

func NewIssuesSet

func NewIssuesSet(cfg *gojira.Config) IssuesSet

func (*IssuesSet) Add

func (is *IssuesSet) Add(issues ...Issue) error

func (*IssuesSet) AddFromAPI

func (is *IssuesSet) AddFromAPI(issues ...jira.Issue) error

func (*IssuesSet) AggregateTimeEstimate

func (is *IssuesSet) AggregateTimeEstimate() int64

func (*IssuesSet) AggregateTimeOriginalEstimate

func (is *IssuesSet) AggregateTimeOriginalEstimate() int64

func (*IssuesSet) AggregateTimeRemainingEstimate

func (is *IssuesSet) AggregateTimeRemainingEstimate() int64

func (*IssuesSet) AggregateTimeSpent

func (is *IssuesSet) AggregateTimeSpent() int64

func (*IssuesSet) Keys

func (is *IssuesSet) Keys() []string

func (*IssuesSet) ReadFile

func (is *IssuesSet) ReadFile(filename string) error

func (*IssuesSet) TSRHistogramSets

func (is *IssuesSet) TSRHistogramSets(name string) *histogram.HistogramSets

TSRHistogramSets returns a `*histogram.HistogramSets` for Type, Status and Resolution.

func (*IssuesSet) TSRTable

func (is *IssuesSet) TSRTable(name string) table.Table

TSRTable returns a `table.Table` for Type, Status and Resolution.

func (*IssuesSet) TSRWriteCSV

func (is *IssuesSet) TSRWriteCSV(filename string) error

TSRWriteCSV writes a CSV file for Type, Status and Resolution.

func (*IssuesSet) TSRWriteXLSX

func (is *IssuesSet) TSRWriteXLSX(filename, sheetname string) error

TSRWriteCSV writes a CSV file for Type, Status and Resolution.

func (*IssuesSet) Table

func (is *IssuesSet) Table(baseURL string) table.Table

type Label

type Label struct {
	Label string `xml:"label"`
}

type Project

type Project struct {
	DisplayName string `xml:",chardata"`
	ID          int    `xml:"id,attr"`
	Key         string `xml:"key,attr"`
}

func (*Project) TrimSpace

func (p *Project) TrimSpace()

type ProjectMeta

type ProjectMeta struct {
	Key  string `json:"key"`
	Name string `json:"name"`
}

type Projects

type Projects []jira.Project

func (Projects) ProjectsMetasMap

func (pp Projects) ProjectsMetasMap() ProjectsMetasMap

type ProjectsAPIResponse

type ProjectsAPIResponse struct {
	Self       string   `json:"self"`
	NextPage   string   `json:"nextPage"`
	MaxResults int      `json:"maxResults"`
	StartAt    int      `json:"startAt"`
	Total      int      `json:"total"`
	IsLast     bool     `json:"isLast"`
	Values     Projects `json:"values"`
}

func NewProjectsAPIResponseFile

func NewProjectsAPIResponseFile(filename string) (ProjectsAPIResponse, error)

type ProjectsMetasMap

type ProjectsMetasMap struct {
	Data map[string]ProjectMeta
}

type RFC1123ZString

type RFC1123ZString string

func RFC1123ZStringJiraTime

func RFC1123ZStringJiraTime(t jira.Time) RFC1123ZString

func (RFC1123ZString) Time

func (s RFC1123ZString) Time() (time.Time, error)

type Simple

type Simple struct {
	ID          int    `xml:"id,attr"`
	DisplayName string `xml:",chardata"`
}

func (*Simple) TrimSpace

func (s *Simple) TrimSpace()

type Status

type Status struct {
	ID          int    `xml:"id,attr"`
	DisplayName string `xml:",chardata"`
	Description string `xml:"description,attr"`
	IconURL     string `xml:"iconUrl"`
}

type StatusCategory

type StatusCategory struct {
	ID          int    `xml:"id,attr"`
	DisplayName string `xml:",chardata"`
	Key         string `xml:"key,attr"`
	ColorName   string `xml:"colorName,attr"`
}

type User

type User struct {
	Display  string `xml:",chardata"`
	Username string `xml:"username,attr"`
}

func (*User) TrimSpace

func (u *User) TrimSpace()

type XML

type XML struct {
	Channel Channel `xml:"channel"`
}

func ReadFile

func ReadFile(name string) (XML, error)

func ReadFileWithDate

func ReadFileWithDate(name string) (XML, time.Time, error)

ReadFileWithDate returns the file and the generation date.

func (*XML) TrimSpace

func (x *XML) TrimSpace()

TrimSpace removes leading and trailing space. It is useful when parsing XML that has been modified, such as by VS Code extensions.

Jump to

Keyboard shortcuts

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