jira

package module
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 4 Imported by: 0

README

go-jira-rest

A package to support REST API calls for Jira Cloud

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoardValues added in v0.0.12

type BoardValues struct {
	ID       int      `json:"id"`
	Self     string   `json:"self"`
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	Location Location `json:"location"`
}

type Boards added in v0.0.9

type Boards struct {
	MaxResults int           `json:"maxResults"`
	StartAt    int           `json:"startAt"`
	Total      int           `json:"total"`
	IsLast     bool          `json:"isLast"`
	Values     []BoardValues `json:"values"`
}

type Comment added in v0.0.22

type Comment struct {
	Body CommentBody `json:"body"`
}

type CommentBody added in v0.0.22

type CommentBody struct {
	Content []CommentBodyContent `json:"content"`
	Type    string               `json:"type"`
	Version int                  `json:"version"`
}

type CommentBodyContent added in v0.0.22

type CommentBodyContent struct {
	Content []CommentBodyContentContent `json:"content"`
	Type    string                      `json:"type"`
}

type CommentBodyContentContent added in v0.0.22

type CommentBodyContentContent struct {
	Text string `json:"text"`
	Type string `json:"type"`
}

type Issues added in v0.0.23

type Issues struct {
	Expand     string        `json:"expand"`
	Issues     []IssuesIssue `json:"issues"`
	MaxResults int           `json:"maxResults"`
	Names      IssuesNames   `json:"names"`
	Schema     IssuesSchema  `json:"schema"`
	StartAt    int           `json:"startAt"`
	Total      int           `json:"total"`
	IsLast     bool          `json:"isLast"`
}

type IssuesIssue added in v0.0.23

type IssuesIssue struct {
	Expand     string                `json:"expand"`
	Fields     IssuesIssueFields     `json:"fields"`
	ID         string                `json:"id"`
	Key        string                `json:"key"`
	Operations IssuesIssueOperations `json:"operations"`
	Self       string                `json:"self"`
}

type IssuesIssueFields added in v0.0.23

type IssuesIssueFields struct {
	Assignee IssuesIssueFieldsAssignee `json:"assignee"`
	Status   IssuesIssueFieldsStatus   `json:"status"`
	Summary  string                    `json:"summary"`
}

type IssuesIssueFieldsAssignee added in v0.0.23

type IssuesIssueFieldsAssignee struct {
	AccountID    string                              `json:"accountId"`
	AccountType  string                              `json:"accountType"`
	Active       bool                                `json:"active"`
	AvatarUrls   IssuesIssueFieldsAssigneeAvatarUrls `json:"avatarUrls"`
	DisplayName  string                              `json:"displayName"`
	EmailAddress string                              `json:"emailAddress"`
	Self         string                              `json:"self"`
	TimeZone     string                              `json:"timeZone"`
}

type IssuesIssueFieldsAssigneeAvatarUrls added in v0.0.23

type IssuesIssueFieldsAssigneeAvatarUrls struct {
	X16x16 string `json:"16x16"`
	X24x24 string `json:"24x24"`
	X32x32 string `json:"32x32"`
	X48x48 string `json:"48x48"`
}

type IssuesIssueFieldsStatus added in v0.0.23

type IssuesIssueFieldsStatus struct {
	Description    string                                `json:"description"`
	IconURL        string                                `json:"iconUrl"`
	ID             string                                `json:"id"`
	Name           string                                `json:"name"`
	Self           string                                `json:"self"`
	StatusCategory IssuesIssueFieldsStatusStatusCategory `json:"statusCategory"`
}

type IssuesIssueFieldsStatusStatusCategory added in v0.0.23

type IssuesIssueFieldsStatusStatusCategory struct {
	ColorName string `json:"colorName"`
	ID        int    `json:"id"`
	Key       string `json:"key"`
	Name      string `json:"name"`
	Self      string `json:"self"`
}

type IssuesIssueOperations added in v0.0.23

type IssuesIssueOperations struct {
	LinkGroups []IssuesIssueOperationsLinkGroup `json:"linkGroups"`
}

type IssuesIssueOperationsLinkGroup added in v0.0.23

type IssuesIssueOperationsLinkGroup struct {
	Groups []IssuesIssueOperationsLinkGroupGroup `json:"groups"`
	ID     string                                `json:"id"`
	Links  []interface{}                         `json:"links"`
}

type IssuesIssueOperationsLinkGroupGroup added in v0.0.23

type IssuesIssueOperationsLinkGroupGroup struct {
	Groups []interface{}                             `json:"groups"`
	ID     string                                    `json:"id"`
	Links  []IssuesIssueOperationsLinkGroupGroupLink `json:"links"`
	Weight int                                       `json:"weight"`
}
type IssuesIssueOperationsLinkGroupGroupLink struct {
	Href       string `json:"href"`
	IconClass  string `json:"iconClass"`
	ID         string `json:"id"`
	Label      string `json:"label"`
	StyleClass string `json:"styleClass"`
	Title      string `json:"title"`
	Weight     int    `json:"weight"`
}

type IssuesNames added in v0.0.23

type IssuesNames struct {
	Assignee string `json:"assignee"`
	Status   string `json:"status"`
	Summary  string `json:"summary"`
}

type IssuesSchema added in v0.0.23

type IssuesSchema struct {
	Assignee IssuesSchemaAssignee `json:"assignee"`
	Status   IssuesSchemaStatus   `json:"status"`
	Summary  IssuesSchemaSummary  `json:"summary"`
}

type IssuesSchemaAssignee added in v0.0.23

type IssuesSchemaAssignee struct {
	System string `json:"system"`
	Type   string `json:"type"`
}

type IssuesSchemaStatus added in v0.0.23

type IssuesSchemaStatus struct {
	System string `json:"system"`
	Type   string `json:"type"`
}

type IssuesSchemaSummary added in v0.0.23

type IssuesSchemaSummary struct {
	System string `json:"system"`
	Type   string `json:"type"`
}

type Jira

type Jira struct {
	BaseUrl   string
	ApiPath   string
	AgilePath string
	User      string
	Token     string
	Client    *resty.Client
}

func New

func New(baseUrl, apiPath, agilePath, user, token string) *Jira

New generate a new jira client

func (*Jira) AddComment

func (r *Jira) AddComment(issue string, comment string) (string, error)

func (*Jira) AddCommentMulti added in v0.0.22

func (r *Jira) AddCommentMulti(issue string, comment *Comment) (string, error)

func (*Jira) AssignIssue added in v0.0.2

func (r *Jira) AssignIssue(issue string, account string) error

func (*Jira) GetAccount added in v0.0.3

func (r *Jira) GetAccount(search string) (string, error)

func (*Jira) GetActiveSprint added in v0.0.11

func (r *Jira) GetActiveSprint(board string) (string, error)

func (*Jira) GetBoards added in v0.0.9

func (r *Jira) GetBoards() (string, error)

func (*Jira) GetIssue

func (r *Jira) GetIssue(issue string) (string, error)

func (*Jira) GetIssuesViaJQL added in v0.0.23

func (r *Jira) GetIssuesViaJQL(jql string) ([]IssuesIssue, error)

func (*Jira) GetSprintIssues added in v0.0.12

func (r *Jira) GetSprintIssues(board string, sprint int) (string, error)

func (*Jira) GetTransitions added in v0.0.8

func (r *Jira) GetTransitions(issue string) (string, error)

func (*Jira) SetDescription added in v0.0.24

func (r *Jira) SetDescription(issue string, description string) (bool, error)

func (*Jira) TransitionIssue added in v0.0.8

func (r *Jira) TransitionIssue(issue string, transitionId string) (string, error)

type Location added in v0.0.9

type Location struct {
	ProjectID      int    `json:"projectId"`
	DisplayName    string `json:"displayName"`
	ProjectName    string `json:"projectName"`
	ProjectKey     string `json:"projectKey"`
	ProjectTypeKey string `json:"projectTypeKey"`
	AvatarURI      string `json:"avatarURI"`
	Name           string `json:"name"`
}

type SprintIssues added in v0.0.12

type SprintIssues struct {
	Expand     string        `json:"expand"`
	StartAt    int           `json:"startAt"`
	MaxResults int           `json:"maxResults"`
	IsLast     bool          `json:"isLast"`
	Total      int           `json:"total"`
	Issues     []interface{} `json:"issues"`
}

Jump to

Keyboard shortcuts

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