Skip to content

Add HTML URL to API Issues #9654

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

Merged
merged 4 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ func (issue *Issue) apiFormat(e Engine) *api.Issue {
apiIssue := &api.Issue{
ID: issue.ID,
URL: issue.APIURL(),
HTMLURL: issue.HTMLURL(),
Index: issue.Index,
Poster: issue.Poster.APIFormat(),
Title: issue.Title,
Expand Down
1 change: 1 addition & 0 deletions modules/structs/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type RepositoryMeta struct {
type Issue struct {
ID int64 `json:"id"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
Index int64 `json:"number"`
Poster *User `json:"user"`
OriginalAuthor string `json:"original_author"`
Expand Down
2 changes: 1 addition & 1 deletion modules/webhook/dingtalk.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func getDingtalkIssuesPayload(p *api.IssuePayload) (*DingtalkPayload, error) {
Title: issueTitle,
HideAvatar: "0",
SingleTitle: "view issue",
SingleURL: p.Issue.URL,
SingleURL: p.Issue.HTMLURL,
},
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion modules/webhook/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func getDiscordIssuesPayload(p *api.IssuePayload, meta *DiscordMeta) (*DiscordPa
{
Title: text,
Description: attachmentText,
URL: p.Issue.URL,
URL: p.Issue.HTMLURL,
Color: color,
Author: DiscordEmbedAuthor{
Name: p.Sender.UserName,
Expand Down
2 changes: 1 addition & 1 deletion modules/webhook/msteams.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func getMSTeamsIssuesPayload(p *api.IssuePayload) (*MSTeamsPayload, error) {
Targets: []MSTeamsActionTarget{
{
Os: "default",
URI: p.Issue.URL,
URI: p.Issue.HTMLURL,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion modules/webhook/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func getSlackIssuesPayload(p *api.IssuePayload, slack *SlackMeta) (*SlackPayload
pl.Attachments = []SlackAttachment{{
Color: fmt.Sprintf("%x", color),
Title: issueTitle,
TitleLink: p.Issue.URL,
TitleLink: p.Issue.HTMLURL,
Text: attachmentText,
}}
}
Expand Down
4 changes: 4 additions & 0 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10305,6 +10305,10 @@
"format": "date-time",
"x-go-name": "Deadline"
},
"html_url": {
"type": "string",
"x-go-name": "HTMLURL"
},
"id": {
"type": "integer",
"format": "int64",
Expand Down