Documentation
¶
Overview ¶
Package agent provides the "jira agent" command group for agentic SDLC. Commands implement a ready → claim → work → discover → close loop backed by Jira Cloud issues, links, and transitions.
Index ¶
- Constants
- func AgentReadyFields() []string
- func FindBlockers(issue *api.Issue) []api.LinkedIssue
- func FindTransitionByCategory(transitions []api.Transition, category string) (*api.Transition, error)
- func IsBlocked(issue *api.Issue) bool
- func MapPriorityRank(priority *api.Priority) int
- func NewCmdAgent(f *factory.Factory) *cobra.Command
- func NewCmdBlocked(f *factory.Factory) *cobra.Command
- func NewCmdClaim(f *factory.Factory) *cobra.Command
- func NewCmdClose(f *factory.Factory) *cobra.Command
- func NewCmdDiscover(f *factory.Factory) *cobra.Command
- func NewCmdPrime(f *factory.Factory) *cobra.Command
- func NewCmdReady(f *factory.Factory) *cobra.Command
- func NewCmdStatus(f *factory.Factory) *cobra.Command
- func ResolveIssueTypeName(ctx context.Context, client *api.Client, project string, wantSubtask bool, ...) string
- func SortByPriorityThenCreated(issues []api.Issue)
- type BlockedOptions
- type ClaimOptions
- type CloseOptions
- type DiscoverOptions
- type PrimeOptions
- type ReadyOptions
- type StatusOptions
Constants ¶
const ( CategoryToDo = "new" CategoryInProgress = "indeterminate" CategoryDone = "done" )
Status category keys used by Jira Cloud. Commands match on these rather than status names for portability across project workflows.
Variables ¶
This section is empty.
Functions ¶
func AgentReadyFields ¶
func AgentReadyFields() []string
AgentReadyFields returns the Jira fields needed for ready queue computation.
func FindBlockers ¶
func FindBlockers(issue *api.Issue) []api.LinkedIssue
FindBlockers returns the list of unresolved blocking issues. A blocker is an issue linked via "is blocked by" whose status category is not "done".
func FindTransitionByCategory ¶
func FindTransitionByCategory(transitions []api.Transition, category string) (*api.Transition, error)
FindTransitionByCategory finds a transition whose target status matches the given category key ("indeterminate", "done", "new").
func MapPriorityRank ¶
MapPriorityRank converts a Jira priority name to a numeric rank (0-4). Lower rank = higher priority. Unknown priorities get rank 2 (Medium).
func NewCmdAgent ¶
NewCmdAgent creates the "agent" command group.
func NewCmdBlocked ¶
NewCmdBlocked creates the "agent blocked" command.
func NewCmdClaim ¶
NewCmdClaim creates the "agent claim" command.
func NewCmdClose ¶
NewCmdClose creates the "agent close" command.
func NewCmdDiscover ¶
NewCmdDiscover creates the "agent discover" command.
func NewCmdPrime ¶
NewCmdPrime creates the "agent prime" command.
func NewCmdReady ¶
NewCmdReady creates the "agent ready" command.
func NewCmdStatus ¶
NewCmdStatus creates the "agent status" command.
func ResolveIssueTypeName ¶
func ResolveIssueTypeName(ctx context.Context, client *api.Client, project string, wantSubtask bool, fallback string) string
ResolveIssueTypeName returns the project's own name for a sub-task or a standard issue type.
The names are not fixed across Jira: a company-managed project calls its sub-task type "Sub-task" while a team-managed one calls it "Subtask", and a project need not have a type called "Task" at all. Hardcoding either name makes the command fail on half the projects in existence.
fallback is returned when the project's metadata cannot be read — the caller is better off attempting the create and surfacing Jira's own error than failing early on a permissions problem.
func SortByPriorityThenCreated ¶
SortByPriorityThenCreated sorts issues by priority rank (ascending), then by created date (ascending) for stable ordering.
Types ¶
type BlockedOptions ¶
BlockedOptions holds all resolved inputs for the agent blocked command.
type ClaimOptions ¶
ClaimOptions holds all resolved inputs for the agent claim command.
type CloseOptions ¶
type CloseOptions struct {
Factory *factory.Factory
KeyOrID string
Reason string
SuggestNext bool
ClaimNext bool
}
CloseOptions holds all resolved inputs for the agent close command.
type DiscoverOptions ¶
type DiscoverOptions struct {
Factory *factory.Factory
ParentKey string
Title string
Description string
Type string
Priority string
Labels []string
AsSubtask bool
LinkType string
BodyFile string
}
DiscoverOptions holds all resolved inputs for the agent discover command.
type PrimeOptions ¶
PrimeOptions holds all resolved inputs for the agent prime command.
type ReadyOptions ¶
type ReadyOptions struct {
Factory *factory.Factory
Project string
Limit int
Assignee string
Unassigned bool
Type string
Labels []string
Priority string
Component string
Sort string
Sprint string
}
ReadyOptions holds all resolved inputs for the agent ready command.
type StatusOptions ¶
StatusOptions holds all resolved inputs for the agent status command.