jira

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadInstances

func LoadInstances(dir string) ([]tracker.Instance, error)

LoadInstances reads config, applies env overrides, creates clients, and returns ready-to-use tracker instances.

func LoadInstancesWithLookup added in v0.18.0

func LoadInstancesWithLookup(dir string, lookup config.EnvLookup) ([]tracker.Instance, error)

LoadInstancesWithLookup is like LoadInstances but uses a custom env lookup function for per-project token scoping.

func LoadInstancesWithResolver added in v0.18.0

func LoadInstancesWithResolver(dir string, lookup config.EnvLookup, resolver config.SecretResolveFunc) ([]tracker.Instance, error)

LoadInstancesWithResolver is like LoadInstances but uses a custom env lookup and a vault secret resolver for 1pw:// references.

Types

type Client

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

Client is a Jira REST API client that implements tracker.Lister and tracker.Getter.

func New

func New(baseURL, user, key string) *Client

New creates a Jira client with the given base URL, user email, and API key.

func (*Client) AddComment

func (c *Client) AddComment(ctx context.Context, issueKey string, body string) (*tracker.Comment, error)

AddComment implements tracker.Commenter.

func (*Client) AssignIssue

func (c *Client) AssignIssue(ctx context.Context, key string, userID string) error

AssignIssue implements tracker.Assigner.

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, issue *tracker.Issue) (*tracker.Issue, error)

CreateIssue implements tracker.Creator.

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(ctx context.Context, key string) error

DeleteIssue implements tracker.Deleter.

func (*Client) EditIssue

func (c *Client) EditIssue(ctx context.Context, key string, opts tracker.EditOptions) (*tracker.Issue, error)

EditIssue implements tracker.Editor.

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser(ctx context.Context) (string, error)

GetCurrentUser implements tracker.CurrentUserGetter.

func (*Client) GetIssue

func (c *Client) GetIssue(ctx context.Context, key string) (*tracker.Issue, error)

GetIssue implements tracker.Getter.

func (*Client) ListComments

func (c *Client) ListComments(ctx context.Context, issueKey string) ([]tracker.Comment, error)

ListComments implements tracker.Commenter.

func (*Client) ListIssues

func (c *Client) ListIssues(ctx context.Context, opts tracker.ListOptions) ([]tracker.Issue, error)

ListIssues implements tracker.Lister.

func (*Client) ListStatuses

func (c *Client) ListStatuses(ctx context.Context, key string) ([]tracker.Status, error)

ListStatuses implements tracker.StatusLister. Returns the available transitions from the issue's current state.

func (*Client) SetHTTPDoer

func (c *Client) SetHTTPDoer(doer apiclient.HTTPDoer)

SetHTTPDoer replaces the HTTP client used for API requests.

func (*Client) TransitionIssue

func (c *Client) TransitionIssue(ctx context.Context, key string, targetStatus string) error

TransitionIssue implements tracker.Transitioner.

type Config

type Config struct {
	Name        string   `mapstructure:"name"`
	URL         string   `mapstructure:"url"`
	User        string   `mapstructure:"user"`
	Key         string   `mapstructure:"key"`
	Description string   `mapstructure:"description"`
	Role        string   `mapstructure:"role"`
	Safe        bool     `mapstructure:"safe"`
	Projects    []string `mapstructure:"projects"`
}

Config holds the configuration for a single Jira instance.

func LoadConfigs

func LoadConfigs(dir string) ([]Config, error)

LoadConfigs reads a .humanconfig YAML file from dir and returns the list of configured Jira instances. Returns nil and no error if the file does not exist.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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