Add suggested branch name to API and MCP ticket responses #84

Merged
Twyco merged 1 commits from koda/ticket-suggested-branch-name-api-mcp into main 2026-05-24 20:56:17 +00:00
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -2,6 +2,7 @@
namespace App\Http\Resources;
use App\Actions\Git\BuildSuggestedTicketBranchName;
use App\Actions\Tickets\Support\AcceptanceCriteriaChecklistMapper;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -53,6 +54,7 @@ class TicketResource extends JsonResource
'project_id' => $this->project_id,
'sequence_number' => $this->sequence_number,
'story_points' => $this->story_points,
'suggested_branch_name' => app(BuildSuggestedTicketBranchName::class)->handle($this->resource),
'ticket_key' => $this->ticket_key,
'ticket_priority' => $this->whenLoaded(
'ticketPriority',
+4 -1
View File
@@ -65,6 +65,7 @@ class TicketApiTest extends TestCase
->assertCreated()
->assertJsonPath('data.ticket_key', 'CORE-1')
->assertJsonPath('data.acceptance_criteria.1.indent', 1)
->assertJsonPath('data.suggested_branch_name', 'core-1-api-ticket')
->assertJsonPath('meta.message', 'CORE-1 was created.');
$ticket = Ticket::query()->findOrFail($createResponse->json('data.id'));
@@ -101,7 +102,9 @@ class TicketApiTest extends TestCase
->getJson(route('api.projects.tickets.show', [$project, $ticket]))
->assertOk()
->assertJsonPath('data.ticket.ticket_key', 'CORE-1')
->assertJsonPath('data.ticket.story_points', 5);
->assertJsonPath('data.ticket.story_points', 5)
->assertJsonPath('data.ticket.suggested_branch_name', 'core-1-updated-api-ticket')
->assertJsonPath('data.suggestedBranchName', 'core-1-updated-api-ticket');
}
public function test_ticket_update_hides_author_for_non_admins_when_author_visibility_is_disabled(): void
+1
View File
@@ -203,6 +203,7 @@ class KanbanGitMcpTest extends TestCase
->where('data.project.name', 'Core project')
->where('data.ticket.ticket_key', 'CORE-1')
->where('data.ticket.description', 'Detailed MCP description')
->where('data.ticket.suggested_branch_name', 'core-1-detailed-ticket')
->etc());
}