core

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package core provides shared business logic for gojira CLI and MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DryRunResult

type DryRunResult struct {
	Valid        bool           `json:"valid"`
	Project      string         `json:"project"`
	Type         string         `json:"type"`
	Summary      string         `json:"summary"`
	Description  string         `json:"description,omitempty"`
	Parent       string         `json:"parent,omitempty"`
	Labels       []string       `json:"labels,omitempty"`
	Priority     string         `json:"priority,omitempty"`
	Assignee     string         `json:"assignee,omitempty"`
	CustomFields map[string]any `json:"custom_fields,omitempty"`
}

DryRunResult shows what would be created.

func DryRunCreate

func DryRunCreate(input *IssueInput) (*DryRunResult, error)

DryRunCreate validates input and returns what would be created without actually creating.

type IssueInput

type IssueInput struct {
	// Standard fields
	Project     string   `yaml:"project" json:"project"`
	Type        string   `yaml:"type" json:"type"`
	Summary     string   `yaml:"summary" json:"summary"`
	Description string   `yaml:"description" json:"description"`
	Parent      string   `yaml:"parent" json:"parent,omitempty"`
	Labels      []string `yaml:"labels" json:"labels,omitempty"`
	Priority    string   `yaml:"priority" json:"priority,omitempty"`
	Assignee    string   `yaml:"assignee" json:"assignee,omitempty"`
	Reporter    string   `yaml:"reporter" json:"reporter,omitempty"`
	Components  []string `yaml:"components" json:"components,omitempty"`
	FixVersions []string `yaml:"fix_versions" json:"fix_versions,omitempty"`

	// Custom fields - keys like customfield_12345
	CustomFields map[string]any `yaml:"-" json:"custom_fields,omitempty"`

	// RawFields captures all fields for custom field extraction
	RawFields map[string]any `yaml:",inline" json:"-"`
}

IssueInput represents the input for creating or updating a Jira issue. Fields map directly to Jira API fields, with customfield_* supported.

func ParseIssueYAML

func ParseIssueYAML(data []byte) (*IssueInput, error)

ParseIssueYAML parses YAML data into IssueInput.

func (*IssueInput) GetCustomFields

func (i *IssueInput) GetCustomFields() map[string]any

GetCustomFields extracts customfield_* entries from RawFields.

type IssueResult

type IssueResult struct {
	Key     string `json:"key"`
	ID      string `json:"id"`
	Self    string `json:"self"`
	Summary string `json:"summary,omitempty"`
}

IssueResult represents the result of a create/update operation.

func CreateIssue

func CreateIssue(ctx context.Context, client *rest.Client, input *IssueInput) (*IssueResult, error)

CreateIssue creates a Jira issue from IssueInput.

func CreateIssueFromFile

func CreateIssueFromFile(ctx context.Context, client *rest.Client, filename string) (*IssueResult, error)

CreateIssueFromFile reads a YAML file and creates a Jira issue.

func CreateIssueFromYAML

func CreateIssueFromYAML(ctx context.Context, client *rest.Client, data []byte) (*IssueResult, error)

CreateIssueFromYAML parses YAML content and creates a Jira issue.

Jump to

Keyboard shortcuts

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