Documentation
¶
Index ¶
- func CheckResponse(r *http.Response) error
- type Category
- type ChangeLog
- type Client
- type Error
- type ErrorResponse
- type Issue
- type IssueComment
- type IssueRequest
- type IssueSearchRequest
- type IssueType
- type IssuesService
- func (s *IssuesService) Create(request IssueRequest) (*Issue, *Response, error)
- func (s *IssuesService) CreateComment(issueKey string, comment string) (*IssueComment, *Response, error)
- func (s *IssuesService) Delete(issueKey string) (*Response, error)
- func (s *IssuesService) Edit(issueKey string, request IssueRequest) (*Issue, *Response, error)
- func (s *IssuesService) Get(issueKey string) (*Issue, *Response, error)
- func (s *IssuesService) ListComments(issueKey string, order string) ([]*IssueComment, *Response, error)
- func (s *IssuesService) Search(request IssueSearchRequest) ([]*Issue, *Response, error)
- type Priority
- type Project
- type ProjectsService
- func (s *ProjectsService) CreateCategory(projectKey string, categoryName string) (*Category, *Response, error)
- func (s *ProjectsService) CreateIssueType(projectKey string, name string, color string) (*IssueType, *Response, error)
- func (s *ProjectsService) DeleteCategory(projectKey string, categoryID string) (*Response, error)
- func (s *ProjectsService) DeleteIssueType(projectKey string, issueTypeID string, substituteIssueTypeID string) (*Response, error)
- func (s *ProjectsService) ListAll() ([]*Project, *Response, error)
- func (s *ProjectsService) ListCategories(projectKey string) ([]*Category, *Response, error)
- func (s *ProjectsService) ListIssueTypes(projectKey string) ([]*IssueType, *Response, error)
- func (s *ProjectsService) ListUsers(projectKey string) ([]*User, *Response, error)
- func (s *ProjectsService) ListVersions(projectKey string) ([]*Version, *Response, error)
- type Resolution
- type Response
- type SpaceService
- type Status
- type User
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present.
Types ¶
type Category ¶
type Category struct { ID int `json:"id"` Name string `json:"name"` ProjectKey string `json:"projectKey"` }
Category is Backlog category in the Backlog project
type ChangeLog ¶
type ChangeLog struct { Field string `json:"field"` NewValue string `json:"newValue"` OriginalValue string `json:"originalValue"` }
ChangeLog is Backlog issue comment
type Client ¶
type Client struct { BaseURL *url.URL // Services Space *SpaceService Projects *ProjectsService Issues *IssuesService // contains filtered or unexported fields }
A Client manages communication with the Backlog API.
type Error ¶ added in v0.2.0
type Error struct { Message string `json:"message"` Code int `json:"code"` MoreInfo string `json:"moreInfo"` }
An Error reports more details on an individual error in an ErrorResponse.
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error Errors []Error `json:"errors"` // more detail on individual errors }
An ErrorResponse reports one or more errors caused by an API request.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Issue ¶
type Issue struct { ID int `json:"id"` ProjectID int `json:"projectId"` IssueKey string `json:"issueKey"` KeyID int `json:"keyId"` Summary string `json:"summary"` Description string `json:"description"` Priority Priority `json:"priority"` Title string `json:"title"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` StartDate time.Time `json:"startDate"` DueDate time.Time `json:"dueDate"` Status struct { ID int `json:"id"` Name string `json:"name"` } `json:"status"` Assignee struct { ID int `json:"id"` Name string `json:"name"` } `json:"assignee"` CreatedUser struct { ID int `json:"id"` UserID string `json:"userId"` Name string `json:"name"` } `json:"createdUser"` IssueType IssueType `json:"issueType"` Categories []Category `json:"category"` // Backlog の仕様では Version と Milestone は同じ型になる Versions []Version `json:"versions"` Milestones []Version `json:"milestone"` }
Issue is Backlog issue
type IssueComment ¶
type IssueComment struct { ID int `json:"id"` Content string `json:"content"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` CreatedUser struct { ID int `json:"id"` UserID string `json:"userId"` Name string `json:"name"` } `json:"createdUser"` ChangeLogs []ChangeLog `json:"changeLog"` }
IssueComment is Backlog issue comment
type IssueRequest ¶
type IssueRequest struct { Summary *string Description *string StatusID *int ProjectID *int PriorityID *int CategoryID *int IssueTypeID *int AssigneeID *int ParentIssueID *int VersionID *int MilestoneID *int StartDate *string DueDate *string }
IssueRequest represents a request to create/edit an issue.
type IssueSearchRequest ¶ added in v0.4.0
type IssueSearchRequest struct { IDs []int `url:"id[],omitempty"` // 課題のID ProjectIDs []int `url:"projectId[],omitempty"` // プロジェクトのID StatusIDs []int `url:"statusId[],omitempty"` // 状態のID PriorityIDs []int `url:"priorityId[],omitempty"` // 優先度のID CategoryIDs []int `url:"categoryId[],omitempty"` // カテゴリーのID VersionIDs []int `url:"versionId[],omitempty"` // 課題の発生バージョンのID MilestoneIDs []int `url:"milestoneId[],omitempty"` // 課題のマイルストーンのID IssueTypeIDs []int `url:"issueTypeId[],omitempty"` // 種別のID AssigneeIDs []int `url:"assigneeId[],omitempty"` // 担当者のID ParentIssueIDs []int `url:"parentIssueId[],omitempty"` // 親課題のID StartDateSince *string `url:"startDateSince[],omitempty"` // 開始日 (yyyy-MM-dd) DueDateSince *string `url:"dueDateSince,omitempty"` // 期限日 (yyyy-MM-dd) ParentChild *int `url:"parentChild,omitempty"` // 親子課題の条件 Sort *string `url:"sort,omitempty"` // 課題一覧のソートに使用する属性名 Order *string `url:"order,omitempty"` // `asc` または `desc` 指定が無い場合は `desc` Keyword *string `url:"keyword,omitempty"` // 検索キーワード Count *int `url:"count,omitempty"` // 取得上限 (1-100) 指定が無い場合は 20 // contains filtered or unexported fields }
IssueSearchRequest represents a request to create/edit an issue. https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-list/
type IssueType ¶
type IssueType struct { ID int `json:"id"` Name string `json:"name"` ProjectID int `json:"projectId"` Color string `json:"color"` DisplayOrder int `json:"displayOrder"` }
IssueType is Backlog issueType in the Backlog project
type IssuesService ¶
type IssuesService service
IssuesService is
func (*IssuesService) Create ¶
func (s *IssuesService) Create(request IssueRequest) (*Issue, *Response, error)
Create creates an issue
func (*IssuesService) CreateComment ¶
func (s *IssuesService) CreateComment(issueKey string, comment string) (*IssueComment, *Response, error)
CreateComment creates a new comment on the specified issue.
https://developer.nulab-inc.com/ja/docs/backlog/api/2/add-comment/
func (*IssuesService) Delete ¶
func (s *IssuesService) Delete(issueKey string) (*Response, error)
Delete an issue
func (*IssuesService) Edit ¶
func (s *IssuesService) Edit(issueKey string, request IssueRequest) (*Issue, *Response, error)
Edit an issue
func (*IssuesService) Get ¶
func (s *IssuesService) Get(issueKey string) (*Issue, *Response, error)
Get an issue.
func (*IssuesService) ListComments ¶
func (s *IssuesService) ListComments(issueKey string, order string) ([]*IssueComment, *Response, error)
ListComments lists all issue comments.
https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comment-list/ order: "asc" or "desc"
func (*IssuesService) Search ¶ added in v0.4.0
func (s *IssuesService) Search(request IssueSearchRequest) ([]*Issue, *Response, error)
Search issues.
type Project ¶
type Project struct { ID int `json:"id"` Name string `json:"name"` ProjectKey string `json:"projectKey"` }
Project is Backlog project in the Backlog space
type ProjectsService ¶
type ProjectsService service
ProjectsService is
func (*ProjectsService) CreateCategory ¶
func (s *ProjectsService) CreateCategory(projectKey string, categoryName string) (*Category, *Response, error)
CreateCategory creates a new category in the project.
func (*ProjectsService) CreateIssueType ¶
func (s *ProjectsService) CreateIssueType(projectKey string, name string, color string) (*IssueType, *Response, error)
CreateIssueType creates a new category in the project.
func (*ProjectsService) DeleteCategory ¶
func (s *ProjectsService) DeleteCategory(projectKey string, categoryID string) (*Response, error)
DeleteCategory deletes a category in the project.
func (*ProjectsService) DeleteIssueType ¶
func (s *ProjectsService) DeleteIssueType(projectKey string, issueTypeID string, substituteIssueTypeID string) (*Response, error)
DeleteIssueType deletes a category in the project.
substituteIssueTypeID: 付け替え先の種別 ID。Backlog の仕様上、最低 1 個の種別を残す必要あり。
func (*ProjectsService) ListAll ¶
func (s *ProjectsService) ListAll() ([]*Project, *Response, error)
ListAll lists all projects.
func (*ProjectsService) ListCategories ¶
func (s *ProjectsService) ListCategories(projectKey string) ([]*Category, *Response, error)
ListCategories lists all issueTypes.
func (*ProjectsService) ListIssueTypes ¶
func (s *ProjectsService) ListIssueTypes(projectKey string) ([]*IssueType, *Response, error)
ListIssueTypes lists all issueTypes.
func (*ProjectsService) ListUsers ¶
func (s *ProjectsService) ListUsers(projectKey string) ([]*User, *Response, error)
ListUsers lists all users in the project.
func (*ProjectsService) ListVersions ¶ added in v0.5.0
func (s *ProjectsService) ListVersions(projectKey string) ([]*Version, *Response, error)
ListVersions lists all versions (milestones).
type Resolution ¶ added in v0.3.0
Resolution is Backlog resolution types in the Backlog space
type SpaceService ¶
type SpaceService service
SpaceService is
func (*SpaceService) ListPriorities ¶
func (s *SpaceService) ListPriorities() ([]*Priority, *Response, error)
ListPriorities lists all priorities.
https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-priority-list/
func (*SpaceService) ListResolutions ¶ added in v0.3.0
func (s *SpaceService) ListResolutions() ([]*Resolution, *Response, error)
ListResolutions lists all resolutions.
https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-resolution-list/
func (*SpaceService) ListStatuses ¶ added in v0.3.0
func (s *SpaceService) ListStatuses() ([]*Status, *Response, error)
ListStatuses lists all statuses.
https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-status-list/
type Version ¶ added in v0.5.0
type Version struct { ID int `json:"id"` Name string `json:"name"` ProjectKey string `json:"projectKey"` Description string `json:"description"` StartDate time.Time `json:"startDate"` ReleaseDueDate time.Time `json:"releaseDueDate"` Archived bool `json:"archived"` }
Version is Backlog version (mileston) in the Backlog project