Browse Source

Exposing TimeEstimate field in the API (#35475)

Time Estimate field is not included in the issue modification webhooks
or issue API endpoints.

This PR fixes the field for the API.

---------

Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@users.noreply.github.com>
Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@cloudparallax.com>
pull/35501/head
Gnanakeethan Balasubramaniam 3 months ago committed by GitHub
parent
commit
fe5afcb022
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      modules/structs/issue.go
  2. 2
      services/convert/issue.go
  3. 5
      templates/swagger/v1_json.tmpl

2
modules/structs/issue.go

@ -76,6 +76,8 @@ type Issue struct { @@ -76,6 +76,8 @@ type Issue struct {
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
TimeEstimate int64 `json:"time_estimate"`
PullRequest *PullRequestMeta `json:"pull_request"`
Repo *RepositoryMeta `json:"repository"`

2
services/convert/issue.go

@ -59,6 +59,8 @@ func toIssue(ctx context.Context, doer *user_model.User, issue *issues_model.Iss @@ -59,6 +59,8 @@ func toIssue(ctx context.Context, doer *user_model.User, issue *issues_model.Iss
Created: issue.CreatedUnix.AsTime(),
Updated: issue.UpdatedUnix.AsTime(),
PinOrder: util.Iif(issue.PinOrder == -1, 0, issue.PinOrder), // -1 means loaded with no pin order
TimeEstimate: issue.TimeEstimate,
}
if issue.Repo != nil {

5
templates/swagger/v1_json.tmpl generated

@ -25728,6 +25728,11 @@ @@ -25728,6 +25728,11 @@
"state": {
"$ref": "#/definitions/StateType"
},
"time_estimate": {
"type": "integer",
"format": "int64",
"x-go-name": "TimeEstimate"
},
"title": {
"type": "string",
"x-go-name": "Title"

Loading…
Cancel
Save