mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-03-03 14:52:10 +02:00
⚡ [STATUS] Add: Get by id
This commit is contained in:
parent
91c5e6ee84
commit
c7afc795d8
18
status.go
18
status.go
@ -45,3 +45,21 @@ func (s *StatusService) GetAllStatusesWithContext(ctx context.Context) ([]Status
|
||||
func (s *StatusService) GetAllStatuses() ([]Status, *Response, error) {
|
||||
return s.GetAllStatusesWithContext(context.Background())
|
||||
}
|
||||
|
||||
func (s *StatusService) Get(id string) (*Status, *Response, error) {
|
||||
apiEndpoint := "rest/api/2/status/" + id
|
||||
req, err := s.client.NewRequestWithContext(context.Background(), "GET", apiEndpoint, nil)
|
||||
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var status Status
|
||||
|
||||
resp, err := s.client.Do(req, &status)
|
||||
if err != nil {
|
||||
return nil, resp, NewJiraError(resp, err)
|
||||
}
|
||||
|
||||
return &status, resp, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user