forked from go-jira/jira
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.go
More file actions
25 lines (21 loc) · 724 Bytes
/
Copy pathproject.go
File metadata and controls
25 lines (21 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package jira
import (
"gopkg.in/Netflix-Skunkworks/go-jira.v1/jiradata"
)
// https://docs.atlassian.com/jira/REST/cloud/#api/2/project-getProjectComponents
func (j *Jira) GetProjectComponents(project string) (*jiradata.Components, error) {
return GetProjectComponents(j.UA, j.Endpoint, project)
}
func GetProjectComponents(ua HttpClient, endpoint string, project string) (*jiradata.Components, error) {
uri := URLJoin(endpoint, "rest/api/2/project", project, "components")
resp, err := ua.GetJSON(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode == 200 {
results := jiradata.Components{}
return &results, readJSON(resp.Body, &results)
}
return nil, responseError(resp)
}