api

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BacklogError

type BacklogError struct {
	Message  string `json:"message"`
	Code     int    `json:"code"`
	MoreInfo string `json:"moreInfo"`
}

BacklogError represents an error response from the Backlog API.

type BacklogErrorResponse

type BacklogErrorResponse struct {
	Errors []BacklogError `json:"errors"`
}

BacklogErrorResponse wraps the errors array in the API response.

type Category

type Category struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Category represents a Backlog category.

type ChangeLog

type ChangeLog struct {
	Field         string `json:"field"`
	NewValue      string `json:"newValue"`
	OriginalValue string `json:"originalValue"`
}

ChangeLog represents a field change in a comment.

type Client

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

Client is the Backlog API client.

func NewClient

func NewClient(spaceURL, apiKey string) *Client

NewClient creates a new Backlog API client.

func (*Client) AddComment

func (c *Client) AddComment(issueIDOrKey string, content string) (*Comment, error)

AddComment adds a comment to an issue.

func (*Client) CreateIssue

func (c *Client) CreateIssue(opts *CreateIssueOptions) (*Issue, error)

CreateIssue creates a new issue.

func (*Client) GetCategories

func (c *Client) GetCategories(projectIDOrKey string) ([]Category, error)

GetCategories returns categories for a project.

func (*Client) GetComments

func (c *Client) GetComments(issueIDOrKey string, count int, order string) ([]Comment, error)

GetComments returns comments for an issue.

func (*Client) GetIssue

func (c *Client) GetIssue(issueIDOrKey string) (*Issue, error)

GetIssue returns a single issue by key or ID.

func (*Client) GetIssueTypes

func (c *Client) GetIssueTypes(projectIDOrKey string) ([]IssueType, error)

GetIssueTypes returns issue types for a project.

func (*Client) GetIssues

func (c *Client) GetIssues(opts *GetIssuesOptions) ([]Issue, error)

GetIssues returns issues matching the given options.

func (*Client) GetMilestones

func (c *Client) GetMilestones(projectIDOrKey string) ([]Milestone, error)

GetMilestones returns milestones for a project.

func (*Client) GetMyself

func (c *Client) GetMyself() (*User, error)

GetMyself returns the authenticated user.

func (*Client) GetPriorities

func (c *Client) GetPriorities() ([]Priority, error)

GetPriorities returns all priorities.

func (*Client) GetProject

func (c *Client) GetProject(projectIDOrKey string) (*Project, error)

GetProject returns a single project.

func (*Client) GetProjectUsers

func (c *Client) GetProjectUsers(projectIDOrKey string) ([]User, error)

GetProjectUsers returns users belonging to a project.

func (*Client) GetProjects

func (c *Client) GetProjects() ([]Project, error)

GetProjects returns all projects.

func (*Client) GetStatuses

func (c *Client) GetStatuses(projectIDOrKey string) ([]Status, error)

GetStatuses returns statuses for a project.

func (*Client) UpdateIssue

func (c *Client) UpdateIssue(issueIDOrKey string, opts *UpdateIssueOptions) (*Issue, error)

UpdateIssue updates an existing issue.

type Comment

type Comment struct {
	ID          int         `json:"id"`
	Content     string      `json:"content"`
	CreatedUser *User       `json:"createdUser"`
	Created     string      `json:"created"`
	ChangeLog   []ChangeLog `json:"changeLog"`
}

Comment represents a Backlog comment.

type CreateIssueOptions

type CreateIssueOptions struct {
	ProjectID    int
	Summary      string
	IssueTypeID  int
	PriorityID   int
	Description  string
	AssigneeID   int
	DueDate      string
	StartDate    string
	MilestoneIDs []int
	CategoryIDs  []int
}

CreateIssueOptions holds parameters for CreateIssue.

type GetIssuesOptions

type GetIssuesOptions struct {
	ProjectIDs   []int
	AssigneeIDs  []int
	StatusIDs    []int
	MilestoneIDs []int
	Keyword      string
	Count        int
	Offset       int
	Sort         string
	Order        string
}

GetIssuesOptions holds parameters for GetIssues.

type Issue

type Issue struct {
	ID          int         `json:"id"`
	ProjectID   int         `json:"projectId"`
	IssueKey    string      `json:"issueKey"`
	Summary     string      `json:"summary"`
	Description string      `json:"description"`
	Status      *Status     `json:"status"`
	Assignee    *User       `json:"assignee"`
	Priority    *Priority   `json:"priority"`
	IssueType   *IssueType  `json:"issueType"`
	DueDate     string      `json:"dueDate"`
	StartDate   string      `json:"startDate"`
	CreatedUser *User       `json:"createdUser"`
	Created     string      `json:"created"`
	Updated     string      `json:"updated"`
	Milestone   []Milestone `json:"milestone"`
	Category    []Category  `json:"category"`
}

Issue represents a Backlog issue.

type IssueType

type IssueType struct {
	ID        int    `json:"id"`
	ProjectID int    `json:"projectId"`
	Name      string `json:"name"`
	Color     string `json:"color"`
}

IssueType represents a Backlog issue type.

type Milestone

type Milestone struct {
	ID             int    `json:"id"`
	ProjectID      int    `json:"projectId"`
	Name           string `json:"name"`
	ReleaseDueDate string `json:"releaseDueDate"`
}

Milestone represents a Backlog milestone/version.

type Priority

type Priority struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Priority represents a Backlog priority.

type Project

type Project struct {
	ID          int    `json:"id"`
	ProjectKey  string `json:"projectKey"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Project represents a Backlog project.

type Status

type Status struct {
	ID        int    `json:"id"`
	ProjectID int    `json:"projectId"`
	Name      string `json:"name"`
	Color     string `json:"color"`
}

Status represents a Backlog status.

type UpdateIssueOptions

type UpdateIssueOptions struct {
	Summary      *string
	Description  *string
	StatusID     *int
	AssigneeID   *int
	PriorityID   *int
	DueDate      *string
	StartDate    *string
	MilestoneIDs []int
	CategoryIDs  []int
	Comment      *string
}

UpdateIssueOptions holds parameters for UpdateIssue. Pointer types are used to distinguish between unset and zero values.

type User

type User struct {
	ID          int    `json:"id"`
	UserID      string `json:"userId"`
	Name        string `json:"name"`
	MailAddress string `json:"mailAddress"`
}

User represents a Backlog user.

Jump to

Keyboard shortcuts

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