Skip to content
Merged
Changes from 1 commit
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
Next Next commit
feat: add type to issues
  • Loading branch information
radar07 committed Jun 6, 2025
commit e733f06faeff8776819367215fa16a4f6988a58d
22 changes: 22 additions & 0 deletions pkg/github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
mcp.WithNumber("milestone",
mcp.Description("Milestone number"),
),
mcp.WithString("type",
mcp.Description("Type of this issue"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
owner, err := requiredParam[string](request, "owner")
Expand Down Expand Up @@ -327,13 +330,20 @@ func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
milestoneNum = &milestone
}

// Get optional type
issueType, err := OptionalParam[string](request, "type")
if err != nil {
return mcp.NewToolResultError(err.Error()), nil
}

// Create the issue request
issueRequest := &github.IssueRequest{
Title: github.Ptr(title),
Body: github.Ptr(body),
Assignees: &assignees,
Labels: &labels,
Milestone: milestoneNum,
Type: &issueType,
Comment thread
JoannaaKL marked this conversation as resolved.
Outdated
}

client, err := getClient(ctx)
Expand Down Expand Up @@ -534,6 +544,9 @@ func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
mcp.WithNumber("milestone",
mcp.Description("New milestone number"),
),
mcp.WithString("type",
mcp.Description("New issue type"),
),
),
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
owner, err := requiredParam[string](request, "owner")
Expand Down Expand Up @@ -604,6 +617,15 @@ func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
issueRequest.Milestone = &milestoneNum
}

// Get issue type
issueType, err := OptionalParam[string](request, "type")
if err != nil {
return mcp.NewToolResultError(err.Error()), nil
}
if issueType != "" {
issueRequest.Type = github.Ptr(issueType)
}
Comment thread
JoannaaKL marked this conversation as resolved.

client, err := getClient(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get GitHub client: %w", err)
Expand Down