@@ -59,6 +59,27 @@ type IssueRequest struct {
59
59
DueDate * string
60
60
}
61
61
62
+ // IssueSearchRequest represents a request to create/edit an issue.
63
+ // https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-list/
64
+ type IssueSearchRequest struct {
65
+ IDs []int `url:"id[],omitempty"` // 課題のID
66
+ ProjectIDs []int `url:"projectId[],omitempty"` // プロジェクトのID
67
+ StatusIDs []int `url:"statusId[],omitempty"` // 状態のID
68
+ PriorityIDs []int `url:"priorityId[],omitempty"` // 優先度のID
69
+ CategoryIDs []int `url:"categoryId[],omitempty"` // カテゴリーのID
70
+ IssueTypeIDs []int `url:"issueTypeId[],omitempty"` // 種別のID
71
+ AssigneeIDs []int `url:"assigneeId[],omitempty"` // 担当者のID
72
+ ParentIssueIDs []int `url:"parentIssueId[],omitempty"` // 親課題のID
73
+ StartDateSince * string `url:"startDateSince[],omitempty"` // 開始日 (yyyy-MM-dd)
74
+ DueDateSince * string `url:"dueDateSince,omitempty"` // 期限日 (yyyy-MM-dd)
75
+ ParentChild * int `url:"parentChild,omitempty"` // 親子課題の条件
76
+ Sort * string `url:"sort,omitempty"` // 課題一覧のソートに使用する属性名
77
+ Order * string `url:"order,omitempty"` // `asc` または `desc` 指定が無い場合は `desc`
78
+ Keyword * string `url:"keyword,omitempty"` // 検索キーワード
79
+ Count * int `url:"count,omitempty"` // 取得上限 (1-100) 指定が無い場合は 20
80
+ offset * int `url:"offset,omitempty"`
81
+ }
82
+
62
83
// Get an issue.
63
84
func (s * IssuesService ) Get (issueKey string ) (* Issue , * Response , error ) {
64
85
u := "issues/" + issueKey
@@ -124,6 +145,22 @@ func (s *IssuesService) Delete(issueKey string) (*Response, error) {
124
145
return resp , nil
125
146
}
126
147
148
+ // Search issues.
149
+ func (s * IssuesService ) Search (request IssueSearchRequest ) ([]* Issue , * Response , error ) {
150
+ u , _ := addOptions ("issues" , request )
151
+ req , err := s .client .NewRequest ("GET" , u , nil )
152
+ if err != nil {
153
+ return nil , nil , err
154
+ }
155
+
156
+ issues := []* Issue {}
157
+ resp , err := s .client .Do (req , & issues )
158
+ if err != nil {
159
+ return nil , resp , err
160
+ }
161
+ return issues , resp , nil
162
+ }
163
+
127
164
func (r IssueRequest ) makeValues () url.Values {
128
165
v := url.Values {}
129
166
if r .ProjectID != nil {
0 commit comments