jira

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package jira contains a small Jira Cloud API client tailored to jiratui's workflow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSameLocalDay

func IsSameLocalDay(t time.Time, day time.Time, loc *time.Location) bool

IsSameLocalDay reports whether t falls on day in loc.

func StatusCategoryForName

func StatusCategoryForName(status string) string

StatusCategoryForName maps common Jira status names to a report bucket.

Types

type Board

type Board struct {
	ID   int
	Name string
	Type string
}

Board is a Jira agile board.

type BoardConfiguration

type BoardConfiguration struct {
	EstimationFieldID   string
	EstimationFieldName string
}

BoardConfiguration contains agile board metadata needed by setup discovery.

type Client

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

Client is a Jira Cloud REST API client.

func NewClient

func NewClient(baseURL, username, token string) (*Client, error)

NewClient creates a Jira Cloud API client using email + API token basic auth.

func (*Client) ActiveSprint

func (c *Client) ActiveSprint(ctx context.Context, boardID int) (Sprint, error)

ActiveSprint returns the active sprint for a Scrum board.

func (*Client) AddIssuesToSprint

func (c *Client) AddIssuesToSprint(ctx context.Context, sprintID int, issueKeys []string) error

AddIssuesToSprint adds issues to a Jira sprint.

func (*Client) AssignIssue

func (c *Client) AssignIssue(ctx context.Context, issueKey string, accountID string) error

AssignIssue assigns an issue to a Jira Cloud account.

func (*Client) BoardConfiguration

func (c *Client) BoardConfiguration(ctx context.Context, boardID int) (BoardConfiguration, error)

BoardConfiguration returns agile board settings such as the estimation field.

func (*Client) CreateTask

func (c *Client) CreateTask(ctx context.Context, input CreateTaskInput) (Issue, error)

CreateTask creates a Jira Task. Add it to a sprint with AddIssuesToSprint afterwards.

func (*Client) DeleteTask added in v0.3.0

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

DeleteTask permanently deletes an issue.

func (*Client) Fields

func (c *Client) Fields(ctx context.Context) ([]Field, error)

Fields returns Jira fields visible to the authenticated user.

func (*Client) IssueStatusChanges

func (c *Client) IssueStatusChanges(ctx context.Context, issue Issue) ([]StatusChange, error)

IssueStatusChanges returns status changes for an issue from Jira changelog.

func (*Client) Myself

func (c *Client) Myself(ctx context.Context) (User, error)

Myself returns the authenticated Jira user.

func (*Client) Project

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

Project returns a Jira project with its issue types.

func (*Client) ProjectIssueTypes

func (c *Client) ProjectIssueTypes(ctx context.Context, projectID string) ([]IssueType, error)

ProjectIssueTypes returns issue types available to a project.

func (*Client) SearchBoards

func (c *Client) SearchBoards(ctx context.Context, projectKeyOrID string) ([]Board, error)

SearchBoards returns agile boards for a project key or id.

func (*Client) SearchMySprintIssues

func (c *Client) SearchMySprintIssues(ctx context.Context, projectKey string, sprintID int, storyPointsFieldID string) ([]Issue, error)

SearchMySprintIssues returns issues assigned to the current user in a sprint.

func (*Client) SearchProjects

func (c *Client) SearchProjects(ctx context.Context, query string) ([]Project, error)

SearchProjects returns Jira projects matching query.

func (*Client) SearchUpdatedIssues

func (c *Client) SearchUpdatedIssues(ctx context.Context, projectKey string, sprintID int, since time.Time, storyPointsFieldID string) ([]Issue, error)

SearchUpdatedIssues returns sprint issues updated since the given time.

func (*Client) TransitionIssue

func (c *Client) TransitionIssue(ctx context.Context, issueKey, transitionID string) error

TransitionIssue applies a Jira workflow transition.

func (*Client) Transitions

func (c *Client) Transitions(ctx context.Context, issueKey string) ([]Transition, error)

Transitions returns all valid workflow transitions for an issue.

func (*Client) UpdateStoryPoints

func (c *Client) UpdateStoryPoints(ctx context.Context, issueKey, storyPointsFieldID string, points *float64) error

UpdateStoryPoints sets or clears the story points custom field for an issue.

func (*Client) UpdateTask added in v0.2.0

func (c *Client) UpdateTask(ctx context.Context, issueKey, summary, description string) error

UpdateTask updates an issue's summary and description.

type CreateTaskInput

type CreateTaskInput struct {
	ProjectKey      string
	IssueTypeID     string
	AssigneeID      string
	Summary         string
	Description     string
	StoryPoints     *float64
	StoryPointsID   string
	AdditionalField map[string]any
}

CreateTaskInput is the payload for creating a Task in the active sprint.

type Field

type Field struct {
	ID         string
	Name       string
	Custom     bool
	SchemaType string
}

Field is a Jira field exposed by the REST API.

type Issue

type Issue struct {
	ID          string
	Key         string
	Summary     string
	Description string
	Status      Status
	IssueType   IssueType
	Assignee    *User
	StoryPoints *float64
	Updated     time.Time
}

Issue is the minimal issue shape used by jiratui.

type IssueType

type IssueType struct {
	ID               string
	Name             string
	UntranslatedName string
	Subtask          bool
}

IssueType is a Jira issue type.

type Project

type Project struct {
	ID         string
	Key        string
	Name       string
	IssueTypes []IssueType
}

Project is a Jira project visible to the authenticated user.

type Sprint

type Sprint struct {
	ID        int
	Name      string
	State     string
	StartDate time.Time
	EndDate   time.Time
}

Sprint is a Jira agile sprint.

type Status

type Status struct {
	ID       string
	Name     string
	Category StatusCategory
}

Status is a Jira issue status.

type StatusCategory

type StatusCategory struct {
	Key  string
	Name string
}

StatusCategory is Jira's status category.

type StatusChange

type StatusChange struct {
	IssueKey     string
	IssueSummary string
	FromStatus   string
	ToStatus     string
	ToCategory   string
	AuthorID     string
	At           time.Time
}

StatusChange is a status transition extracted from an issue changelog.

type Transition

type Transition struct {
	ID       string
	Name     string
	ToStatus Status
}

Transition is a valid Jira workflow transition for an issue.

type User

type User struct {
	AccountID   string
	DisplayName string
	Email       string
}

User is a Jira user.

Jump to

Keyboard shortcuts

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