Skip to content

Commit

Permalink
Fix reporting of YouTrack issues by changing the default issue type t…
Browse files Browse the repository at this point in the history
…o Performance Problem

There's a YouTrack workflow now that blocks creation of Bugs without an affected version.
  • Loading branch information
emrzv authored and MaXal committed Jan 30, 2025
1 parent bf1451b commit 1af0b60
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/server/meta/yourtrackClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ type Visibility struct {
}

type CreateIssueInfo struct {
Summary string `json:"summary"`
Description string `json:"description"`
Project YoutrackProject `json:"project"`
Reporter *auth.YTUser `json:"reporter,omitempty"`
Visibility Visibility `json:"visibility"`
Summary string `json:"summary"`
Description string `json:"description"`
Project YoutrackProject `json:"project"`
Reporter *auth.YTUser `json:"reporter,omitempty"`
Visibility Visibility `json:"visibility"`
CustomFields []CustomField `json:"customFields"`
}

func NewYoutrackClient(youTrackUrl, youtrackToken string) *YoutrackClient {
Expand Down
11 changes: 11 additions & 0 deletions pkg/server/meta/youtrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ func CreatePostCreateIssueByAccident(metaDb *pgxpool.Pool) http.HandlerFunc {
PermittedUsers: []auth.YTUser{{ID: "11-1539792"}},
Type: "LimitedVisibility",
},
CustomFields: []CustomField{
{
Name: "Type",
Type: "SingleEnumIssueCustomField",
Value: struct {
Name string `json:"name"`
}{
Name: "Performance Problem",
},
},
},
}

issue, err := youtrackClient.CreateIssue(request.Context(), issueInfo)
Expand Down

0 comments on commit 1af0b60

Please sign in to comment.