I trying to add an Action in CiviRules. I am trying to follow the API add instructions.

Here is what I did 1. Copied the file org.civicoop.civirules/CRM/CivirulesActions/Activity/UpdateStatus.php (this looked like an easy edit to do what I wanted--update a field) and created a new file in org.civicoop.civirules/CRM/CivirulesActions/Contributions/UpdateInstallments.php

  1. I edited the copied file (edits in bold)

` * @license http://www.gnu.org/licenses/agpl-3.0.html */

class CRM_CivirulesActions_Contribution_UpdateInstallments extends CRM_CivirulesActions_Generic_Api {

/** * Method to get the api entity to process in this CiviRule action * * @access protected * @abstract */ protected function getApiEntity() { return 'Contribution'; }`

But it does not show up in the Rules option list. I tried a cache clear. What am I doing wrong?


There is documentation on how to add your own action here: https://docs.civicrm.org/civirules/en/latest/create-your-own-action/.

I would recommend reading the documentation, it will give you a better understanding of what is required. And then copy and adapt as much as you like :-)

If you do not see it in the list of actions it is because you have copied the class, but not added a record to the civirule_action table (from what you describe).

  • I had Inserted the action in civirules_action table by filling the fields. I deleted that row and did a SQL Insert query and then it worked. – Iowa Boy Feb 2 '19 at 4:22
  • glad it did :-) – ErikH - CiviCooP Feb 2 '19 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.