3 final class ManiphestGetTaskTransactionsConduitAPIMethod
4 extends ManiphestConduitAPIMethod
{
6 public function getAPIMethodName() {
7 return 'maniphest.gettasktransactions';
10 public function getMethodDescription() {
11 return pht('Retrieve Maniphest task transactions.');
14 protected function defineParamTypes() {
16 'ids' => 'required list<int>',
20 protected function defineReturnType() {
21 return 'nonempty list<dict<string, wild>>';
24 public function getMethodStatus() {
25 return self
::METHOD_STATUS_FROZEN
;
28 public function getMethodStatusDescription() {
30 'This method is frozen and will eventually be deprecated. New code '.
31 'should use "transaction.search" instead.');
34 protected function execute(ConduitAPIRequest
$request) {
36 $task_ids = $request->getValue('ids');
42 $tasks = id(new ManiphestTaskQuery())
43 ->setViewer($request->getUser())
46 $tasks = mpull($tasks, null, 'getPHID');
48 $transactions = array();
50 $transactions = id(new ManiphestTransactionQuery())
51 ->setViewer($request->getUser())
52 ->withObjectPHIDs(mpull($tasks, 'getPHID'))
57 foreach ($transactions as $transaction) {
58 $task_phid = $transaction->getObjectPHID();
59 if (empty($tasks[$task_phid])) {
63 $task_id = $tasks[$task_phid]->getID();
66 if ($transaction->hasComment()) {
67 $comments = $transaction->getComment()->getContent();
70 $results[$task_id][] = array(
72 'transactionID' => $transaction->getID(),
73 'transactionPHID' => $transaction->getPHID(),
74 'transactionType' => $transaction->getTransactionType(),
75 'oldValue' => $transaction->getOldValue(),
76 'newValue' => $transaction->getNewValue(),
77 'comments' => $comments,
78 'authorPHID' => $transaction->getAuthorPHID(),
79 'dateCreated' => $transaction->getDateCreated(),