@@ -553,39 +553,39 @@ func RemoveSubIssue(getClient GetClientFn, t translations.TranslationHelperFunc)
553
553
}
554
554
555
555
client , err := getClient (ctx )
556
- if err != nil {
557
- return nil , fmt .Errorf ("failed to get GitHub client: %w" , err )
558
- }
559
-
560
- subIssueRequest := github.SubIssueRequest {
561
- SubIssueID : int64 (subIssueID ),
562
- }
563
-
564
- subIssue , resp , err := client .SubIssue .Remove (ctx , owner , repo , int64 (issueNumber ), subIssueRequest )
565
- if err != nil {
566
- return ghErrors .NewGitHubAPIErrorResponse (ctx ,
567
- "failed to remove sub-issue" ,
568
- resp ,
569
- err ,
570
- ), nil
571
- }
572
- defer func () { _ = resp .Body .Close () }()
573
-
574
- if resp .StatusCode != http .StatusOK {
575
- body , err := io .ReadAll (resp .Body )
576
- if err != nil {
577
- return nil , fmt .Errorf ("failed to read response body: %w" , err )
578
- }
579
- return mcp .NewToolResultError (fmt .Sprintf ("failed to remove sub-issue: %s" , string (body ))), nil
580
- }
581
-
582
- r , err := json .Marshal (subIssue )
583
- if err != nil {
584
- return nil , fmt .Errorf ("failed to marshal response: %w" , err )
585
- }
586
-
587
- return mcp .NewToolResultText (string (r )), nil
588
- }
556
+ if err != nil {
557
+ return nil , fmt .Errorf ("failed to get GitHub client: %w" , err )
558
+ }
559
+
560
+ subIssueRequest := github.SubIssueRequest {
561
+ SubIssueID : int64 (subIssueID ),
562
+ }
563
+
564
+ subIssue , resp , err := client .SubIssue .Remove (ctx , owner , repo , int64 (issueNumber ), subIssueRequest )
565
+ if err != nil {
566
+ return ghErrors .NewGitHubAPIErrorResponse (ctx ,
567
+ "failed to remove sub-issue" ,
568
+ resp ,
569
+ err ,
570
+ ), nil
571
+ }
572
+ defer func () { _ = resp .Body .Close () }()
573
+
574
+ if resp .StatusCode != http .StatusOK {
575
+ body , err := io .ReadAll (resp .Body )
576
+ if err != nil {
577
+ return nil , fmt .Errorf ("failed to read response body: %w" , err )
578
+ }
579
+ return mcp .NewToolResultError (fmt .Sprintf ("failed to remove sub-issue: %s" , string (body ))), nil
580
+ }
581
+
582
+ r , err := json .Marshal (subIssue )
583
+ if err != nil {
584
+ return nil , fmt .Errorf ("failed to marshal response: %w" , err )
585
+ }
586
+
587
+ return mcp .NewToolResultText (string (r )), nil
588
+ }
589
589
}
590
590
591
591
// ReprioritizeSubIssue creates a tool to reprioritize a sub-issue to a different position in the parent list.
@@ -848,7 +848,10 @@ func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
848
848
Assignees : & assignees ,
849
849
Labels : & labels ,
850
850
Milestone : milestoneNum ,
851
- Type : typePtr ,
851
+ }
852
+
853
+ if issueType != "" {
854
+ issueRequest .Type = github .Ptr (issueType )
852
855
}
853
856
854
857
client , err := getClient (ctx )
0 commit comments