Answers.Body: <p>There is documentation on how to add your own action here: <a href="https://docs.civicrm.org/civirules/en/latest/create-your-own-action/" rel="nofollow noreferrer">https://docs.civicrm.org/civirules/en/latest/create-your-own-action/</a>.</p>
  
  <p>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 :-)</p>
  
  <p>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).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-02T04:22:39.780Z
Answers.Text: 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.
Answers.UserDisplayName: Iowa Boy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-02T11:06:59.227Z
Answers.Text: glad it did :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-31T08:49:19.553Z
Answers.LastActivityDate: 2019-01-31T08:49:19.553Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I trying to add an Action in CiviRules. I am trying to follow the <a href="https://docs.civicrm.org/civirules/en/latest/create-your-own-action/#adding-an-action-using-the-api" rel="nofollow noreferrer">API add instructions</a>.</p>
  
  <p>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</p>
  
  <ol start="2">
  <li>I edited the copied file (edits in bold)</li>
  </ol>
  
  <p>`
   * @license <a href="http://www.gnu.org/licenses/agpl-3.0.html" rel="nofollow noreferrer">http://www.gnu.org/licenses/agpl-3.0.html</a>
   */</p>
  
  <p><strong>class CRM_CivirulesActions_Contribution_UpdateInstallments</strong> extends CRM_CivirulesActions_Generic_Api {</p>
  
  <p>/**
     * Method to get the api entity to process in this CiviRule action
     *
     * @access protected
     * @abstract
     */
    protected function getApiEntity() {
      return '<strong>Contribution</strong>';
    }`</p>
  
  <p>But it does not show up in the Rules option list. I tried a cache clear. What am I doing wrong?</p>
  
Tags: <civirules>
Title: Help adding an Action in CiviRules
ThreadText: # Help adding an Action in CiviRules
  
  (Asked by: username_0 on 2019-01-31)
  
  I trying to add an Action in CiviRules. I am trying to follow the [API add instructions](https://docs.civicrm.org/civirules/en/latest/create-your-own-action/#adding-an-action-using-the-api).
  
  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
  
  2. 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?
  
  **Tags:** civirules
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-31. Score: 1 | Accepted answer
  
  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).
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_1**: glad it did :-)  
  
  ---
  
  