SELECT TOP(1)[Id], [WorkspaceId], [SystemType], [Endpoint], [Token], [AuthType], [BotUserName], [ProjectKey], [TypeField], [StatusField], [EstimateField], [PriorityField], [IsPrimary], [CreatedAt], [ConnectedAtUtc], [ConnectionState], [LastTestError], [LastTestedAtUtc], [WebhookId], [WebhookSecret], [CreateIntegrationIssuesOnDecomposition], [AutoAssignIntegrationIssuesOnDecomposition]
FROM [dbo].[WorkspaceIntegrations]
WHERE [ProjectKey] = @ProjectKey
ORDER BY [CreatedAt] DESC;
