1
0
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:
Chhekur 2021-09-04 19:06:50 +05:30
parent 91c5e6ee84
commit c7afc795d8

View File

@ -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
}