-
-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add sprint agile apis #471
base: main
Are you sure you want to change the base?
Conversation
type Sprint struct { | ||
ID int `json:"id" structs:"id"` | ||
Name string `json:"name" structs:"name"` | ||
CompleteDate *time.Time `json:"completeDate" structs:"completeDate"` | ||
EndDate *time.Time `json:"endDate" structs:"endDate"` | ||
StartDate *time.Time `json:"startDate" structs:"startDate"` | ||
OriginBoardID int `json:"originBoardId" structs:"originBoardId"` | ||
Self string `json:"self" structs:"self"` | ||
State string `json:"state" structs:"state"` | ||
ID int `json:"id,omitempty" structs:"id,omitempty"` | ||
Name string `json:"name,omitempty" structs:"name,omitempty"` | ||
CompleteDate *time.Time `json:"completeDate,omitempty" structs:"completeDate,omitempty"` | ||
EndDate *time.Time `json:"endDate,omitempty" structs:"endDate,omitempty"` | ||
StartDate *time.Time `json:"startDate,omitempty" structs:"startDate,omitempty"` | ||
OriginBoardID int `json:"originBoardId,omitempty" structs:"originBoardId,omitempty"` | ||
Self string `json:"self,omitempty" structs:"self,omitempty"` | ||
State string `json:"state,omitempty" structs:"state,omitempty"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sprint
struct has been used only in unmarshaling JSON responses from /boards API call.
So adding omitempty
will not break any of current behaviours.
// UpdateSprintWithContext partially updates a sprint from a JSON representation. The sprint is found by ID. | ||
// | ||
// Jira API docs: https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/sprint-partiallyUpdateSprint | ||
// Caller must close resp.Body | ||
func (s *SprintService) UpdateSprintWithContext(ctx context.Context, sprintID int, data map[string]interface{}) (*Response, error) { | ||
apiEndpoint := fmt.Sprintf("rest/agile/1.0/sprint/%v", sprintID) | ||
|
||
req, err := s.client.NewRequestWithContext(ctx, "POST", apiEndpoint, data) | ||
if err != nil { | ||
return nil, err | ||
} | ||
resp, err := s.client.Do(req, nil) | ||
if err != nil { | ||
jerr := NewJiraError(resp, err) | ||
return resp, jerr | ||
} | ||
|
||
return resp, nil | ||
} | ||
|
||
// UpdateSprint wraps UpdateSprintWithContext using the background context. | ||
// Caller must close resp.Body | ||
func (s *SprintService) UpdateSprint(sprintID int, data map[string]interface{}) (*Response, error) { | ||
return s.UpdateSprintWithContext(context.Background(), sprintID, data) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've followed the format that caller must close response body
Hey, I am very sorry that this pull request has been open for a long time with no final feedback or merge/decline. We work on this project in our spare time, and sometimes, other priorities take over. This is the typical open source dilemma. However, there is news: We are kicking off v2 of this library 🚀To provide visibility, we created the Road to v2 Milestone and calling for your feedback in #489 The development will take some time; however, I hope you can benefit from the changes. What does this mean for my pull request?We will work on this pull request indirectly. Final wordsThanks for using and contributing to this library. |
Description
(1) What
Board
is fully implemented in go-jira for now, butSprint
is partially implementedSprint
(2) Why
(3) Type of change
(4) Breaking change
(5) Related issue
Example
Checklist
Unit or Integration tests added
Commits follow conventions described here:
Commits are squashed such that
I've not made extraneous commits/changes that are unrelated to my change.