diff --git a/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php b/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php index 43b94874bf..66285547b3 100644 --- a/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php +++ b/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php @@ -22,6 +22,7 @@ final class TransactionSearchConduitAPIMethod protected function defineParamTypes() { return array( 'objectIdentifier' => 'phid|string', + 'constraints' => 'map', ) + $this->getPagerParamTypes(); } @@ -66,10 +67,23 @@ final class TransactionSearchConduitAPIMethod $xaction_query = PhabricatorApplicationTransactionQuery::newQueryForObject( $object); - $xactions = $xaction_query + $xaction_query ->withObjectPHIDs(array($object->getPHID())) - ->setViewer($viewer) - ->executeWithCursorPager($pager); + ->setViewer($viewer); + + $constraints = $request->getValue('constraints', array()); + PhutilTypeSpec::checkMap( + $constraints, + array( + 'phids' => 'optional list', + )); + + $with_phids = idx($constraints, 'phids'); + if ($with_phids) { + $xaction_query->withPHIDs($with_phids); + } + + $xactions = $xaction_query->executeWithCursorPager($pager); if ($xactions) { $template = head($xactions)->getApplicationTransactionCommentObject();