workflow

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package workflow provides workflow stage mapping for JIRA statuses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Stages    []Stage
	CycleTime CycleTimeConfig
}

Config holds the complete workflow configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a sensible default workflow configuration.

type CycleTimeConfig

type CycleTimeConfig struct {
	Started   string // Stage name where cycle time starts
	Completed string // Stage name where cycle time ends
}

CycleTimeConfig defines which stages mark the start and end of cycle time.

type IssueHistory

type IssueHistory struct {
	Key          string
	Type         string
	Summary      string
	Created      time.Time
	Completed    *time.Time
	CurrentStage string
	Transitions  []StageTransition
	// Raw JIRA fields preserved for export
	Assignee string
	Priority string
	Labels   []string
	EpicKey  string
}

IssueHistory represents an issue with its workflow history.

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

Mapper maps JIRA statuses to workflow stages.

func NewMapper

func NewMapper(config Config) *Mapper

NewMapper creates a new workflow mapper from configuration.

func (*Mapper) GetCycleTimeStages

func (m *Mapper) GetCycleTimeStages() (start, end string)

GetCycleTimeStages returns the start and end stages for cycle time calculation.

func (*Mapper) GetStage

func (m *Mapper) GetStage(status string) string

GetStage returns the stage name for a JIRA status.

func (*Mapper) GetStageNames

func (m *Mapper) GetStageNames() []string

GetStageNames returns stage names in workflow order.

func (*Mapper) GetStageOrder

func (m *Mapper) GetStageOrder(stageName string) int

GetStageOrder returns the order of a stage (lower = earlier in workflow).

func (*Mapper) GetStages

func (m *Mapper) GetStages() []Stage

GetStages returns all configured stages in order.

func (*Mapper) IsCompleted

func (m *Mapper) IsCompleted(status string) bool

IsCompleted returns true if the status maps to the "done" category.

func (*Mapper) MapIssueHistory

func (m *Mapper) MapIssueHistory(issue jira.IssueWithHistory) IssueHistory

MapIssueHistory converts a JIRA issue with status transitions to workflow stage history.

func (*Mapper) TimeInStage

func (m *Mapper) TimeInStage(history IssueHistory) map[string]time.Duration

TimeInStage calculates how long an issue spent in each stage.

type Stage

type Stage struct {
	Name     string   // Stage name (e.g., "In Progress", "Done")
	Statuses []string // JIRA status names that map to this stage
	Category string   // Category: "todo", "in_progress", "done"
	Order    int      // Position in workflow (0 = earliest, higher = later)
}

Stage represents a workflow stage that groups multiple JIRA statuses.

type StageTransition

type StageTransition struct {
	Timestamp time.Time
	FromStage string
	ToStage   string
}

StageTransition represents a transition between workflow stages.

Jump to

Keyboard shortcuts

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