jira

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

README

jira PkgGoDev

封装了JIRA Server的HTTP API。JIRA的API文档参见 JIRA Agile Server REST API reference

API支持

  • Agile Board
    • Get all boards
    • Create board
    • Get board
    • Delete board
    • Get issues for backlog
    • Get configuration
    • Get issues for board
  • Agile Board Sprint
    • Get all sprints
    • Get issues for sprints

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	*Client

	Id   int
	Self string
	Name string
	Type string
}

func (*Board) Issue

func (board *Board) Issue(jql string) ([]*Issue, error)

Issue 返回Board的Issue列表

func (*Board) Sprint

func (board *Board) Sprint(states ...string) ([]*Sprint, error)

Sprint 返回Board的Sprint列表

type Client

type Client struct {
	http.Client

	ServerAddr string
	Username   string
	Password   string
}

func (*Client) AgileBoard

func (cli *Client) AgileBoard(boardType, name, projectKeyOrId string) ([]*Board, error)

AgileBoard 返回Board列表

func (*Client) Request

func (cli *Client) Request(method, path string, query url.Values, respInfo interface{}) error

type CommonResponse

type CommonResponse struct {
	Expand     string
	StartAt    int
	MaxResults int
	Total      int
}

ApiResponse 表示通用的JIRA响应

type Issue

type Issue struct {
	*Client

	IssueAttributes

	Id     string
	Self   string
	Key    string
	Expand string
	Fields json.RawMessage
}

func (*Issue) ParseAttributes

func (issue *Issue) ParseAttributes() error

type IssueAttributes

type IssueAttributes struct {
	Summary     string
	Description string
	Assignee    User
	Reporter    User
	Creator     User
	Flagged     bool
	WorkRatio   float32

	Project Project
	Status  Status

	Created string
	Updated string

	IssueType struct {
		Self        string
		Id          string
		Description string
		IconUrl     string
		Name        string
		Subtask     bool
		AvatarId    int
	}

	Watches struct {
		Self       string
		WatchCount int
		IsWatching bool
	}

	Priority struct {
		Self    string
		IconUrl string
		Name    string
		Id      string
	}
	// contains filtered or unexported fields
}

type Project

type Project struct {
	Self            string
	Id              string
	Key             string
	Name            string
	AvatarUrls      map[string]string
	ProjectCategory ProjectCategory
}

type ProjectCategory

type ProjectCategory struct {
	Self        string
	Id          string
	Name        string
	Description string
}

type Sprint

type Sprint struct {
	*Board

	Id            int
	Self          string
	Name          string
	State         string
	StartDate     string
	EndDate       string
	CompleteDate  string
	OriginBoardId int
}

func (*Sprint) Issue

func (sprint *Sprint) Issue(jql string) ([]*Issue, error)

Issue 返回Sprint的Issue列表

type Status

type Status struct {
	Self           string
	Description    string
	IconUrl        string
	Name           string
	Id             string
	StatusCategory StatusCategory
}

type StatusCategory

type StatusCategory struct {
	Self      string
	Id        int
	Key       string
	ColorName string
	Name      string
}

type User

type User struct {
	Self         string
	Name         string
	Key          string
	EmailAddress string
	AvatarUrls   map[string]string
	DisplayName  string
	Active       bool
	TimeZone     string
}

Jump to

Keyboard shortcuts

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