getAdapter(); // NOTE: $object is the object being edited. If you didn't change the // implementation of `supportsObject()`, it's a ManiphestTask. // Transactions which were just applied. $applied_xactions = $adapter->getAppliedTransactions(); $comment_text = pht( 'This edit applied %s transactions.', phutil_count($applied_xactions)); $comment = $adapter->newTransaction() ->getApplicationTransactionCommentObject() ->setContent($comment_text); $xaction = $adapter->newTransaction() ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) ->attachComment($comment); // Use queueTransaction() to queue up transactions to be applied. $adapter->queueTransaction($xaction); // This makes the effect observable in the Herald transcript. $this->logEffect(self::DO_COUNT); } public function getHeraldActionStandardType() { // You can change this to give your action an editable value in the UI, // like how "Add Subscribers: ..." allows you to choose subscribers to add. // This might let you make a more modular/flexible action. return self::STANDARD_NONE; } public function renderActionDescription($value) { return pht('Count task transactions'); } protected function getActionEffectMap() { return array( self::DO_COUNT => array( 'icon' => 'fa-sort-numeric-asc', 'color' => 'violet', 'name' => pht('Counted transactions.'), ), ); } protected function renderActionEffectDescription($type, $data) { switch ($type) { case self::DO_COUNT: return pht('Added comment.'); } } }