diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 12e3646dda..82481826a2 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -125,6 +125,7 @@ phutil_register_library_map(array( 'ConduitAPI_maniphest_Method' => 'applications/conduit/method/maniphest/base', 'ConduitAPI_maniphest_createtask_Method' => 'applications/conduit/method/maniphest/createtask', 'ConduitAPI_maniphest_find_Method' => 'applications/conduit/method/maniphest/find', + 'ConduitAPI_maniphest_gettasktransactions_Method' => 'applications/conduit/method/maniphest/gettasktransactions', 'ConduitAPI_maniphest_info_Method' => 'applications/conduit/method/maniphest/info', 'ConduitAPI_maniphest_update_Method' => 'applications/conduit/method/maniphest/update', 'ConduitAPI_paste_Method' => 'applications/conduit/method/paste/base', @@ -880,6 +881,7 @@ phutil_register_library_map(array( 'ConduitAPI_maniphest_Method' => 'ConduitAPIMethod', 'ConduitAPI_maniphest_createtask_Method' => 'ConduitAPI_maniphest_Method', 'ConduitAPI_maniphest_find_Method' => 'ConduitAPI_maniphest_Method', + 'ConduitAPI_maniphest_gettasktransactions_Method' => 'ConduitAPI_maniphest_Method', 'ConduitAPI_maniphest_info_Method' => 'ConduitAPI_maniphest_Method', 'ConduitAPI_maniphest_update_Method' => 'ConduitAPI_maniphest_Method', 'ConduitAPI_paste_Method' => 'ConduitAPIMethod', diff --git a/src/applications/conduit/method/maniphest/gettasktransactions/ConduitAPI_maniphest_gettasktransactions_Method.php b/src/applications/conduit/method/maniphest/gettasktransactions/ConduitAPI_maniphest_gettasktransactions_Method.php new file mode 100644 index 0000000000..d272026296 --- /dev/null +++ b/src/applications/conduit/method/maniphest/gettasktransactions/ConduitAPI_maniphest_gettasktransactions_Method.php @@ -0,0 +1,74 @@ + 'required list', + ); + } + + public function defineReturnType() { + return 'nonempty list>'; + } + + public function defineErrorTypes() { + return array( + ); + } + + protected function execute(ConduitAPIRequest $request) { + $results = array(); + $task_ids = $request->getValue('ids'); + + if (!$task_ids) { + return $results; + } + + $transactions = id(new ManiphestTransaction())->loadAllWhere( + 'taskID IN (%Ld) ORDER BY id ASC', + $task_ids); + + foreach ($transactions as $transaction) { + $task_id = $transaction->getTaskID(); + if (!array_key_exists($task_id, $results)) { + $results[$task_id] = array(); + } + $results[$task_id][] = array( + 'taskID' => $task_id, + 'transactionType' => $transaction->getTransactionType(), + 'oldValue' => $transaction->getOldValue(), + 'newValue' => $transaction->getNewValue(), + 'comments' => $transaction->getComments(), + 'authorPHID' => $transaction->getAuthorPHID(), + 'dateCreated' => $transaction->getDateCreated(), + ); + } + + return $results; + } +} diff --git a/src/applications/conduit/method/maniphest/gettasktransactions/__init__.php b/src/applications/conduit/method/maniphest/gettasktransactions/__init__.php new file mode 100644 index 0000000000..1aa66635e4 --- /dev/null +++ b/src/applications/conduit/method/maniphest/gettasktransactions/__init__.php @@ -0,0 +1,15 @@ +