Answers.Body: <p>I would debug the Field Value Comparison (class CRM_CivirulesConditions_Generic_ValueComparison and function isConditionValid) to check if the condition is OK.</p>
  <p>What CiviRules action are you using to create the case?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-23T06:27:49.263Z
Answers.LastActivityDate: 2022-09-23T06:27:49.263Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I'm trying to use CiviRules in WordPress to create a new Case for contact records using a Field Value Comparison (when a custom data field &quot;is not empty&quot;).</p>
  <p>My test cases are confirming that the rule is executing and certain other rule Actions are being applied (e.g. adding the contact to a Group), but the Case is not being created on the Contact record.</p>
  <p>There is a log entry that is added each time the rule executes that I believe is related to why the Case is not being created, but I am not sure how to interpret it.</p>
  <p>It's an error message that says Rule: 'Test Rule' with id xx failed for contact xxxxx because of Failed to execute action.</p>
  <p>For more detail, here is the Context section of the error message:</p>
  <pre><code>(
      [rule_title] =&gt; Test Rule
      [original_error] =&gt; Civirules could not fund case: Expected one Case but found 0. API call: Case.getsingle with params: contact_id=&quot;xxxx&quot;, case_type_id=&quot;3&quot;, status_id=&quot;1&quot;
      [reason] =&gt; Failed to execute action
  )
  </code></pre>
  <p>Any insight that can be provided about places to look for additional information or things I possibly may not have configured properly would be very helpful.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-07-26T16:44:44.277Z
Comments.Text: Hello, Rainer. Did you ever get a resolution to this issue? I've encountered the exact same error as you.
Comments.UserDisplayName: gillenpj
Tags: <wordpress><civicase><civirules>
Title: Using CiviRules to create a Case on a Contact record
ThreadText: # Using CiviRules to create a Case on a Contact record
  
  (Asked by: username_0 on 2022-09-20)
  
  I'm trying to use CiviRules in WordPress to create a new Case for contact records using a Field Value Comparison (when a custom data field "is not empty").
  My test cases are confirming that the rule is executing and certain other rule Actions are being applied (e.g. adding the contact to a Group), but the Case is not being created on the Contact record.
  There is a log entry that is added each time the rule executes that I believe is related to why the Case is not being created, but I am not sure how to interpret it.
  It's an error message that says Rule: 'Test Rule' with id xx failed for contact xxxxx because of Failed to execute action.
  For more detail, here is the Context section of the error message:
  (
      [rule_title] => Test Rule
      [original_error] => Civirules could not fund case: Expected one Case but found 0. API call: Case.getsingle with params: contact_id="xxxx", case_type_id="3", status_id="1"
      [reason] => Failed to execute action
  )
  
  Any insight that can be provided about places to look for additional information or things I possibly may not have configured properly would be very helpful.
  
  **Tags:** wordpress, civicase, civirules
  
  > **Comments:**
  > **username_1**: Hello, username_0. Did you ever get a resolution to this issue? I've encountered the exact same error as you.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-09-23. Score: 1
  
  I would debug the Field Value Comparison (class CRM\_CivirulesConditions\_Generic\_ValueComparison and function isConditionValid) to check if the condition is OK.
  
  What CiviRules action are you using to create the case?
  
  
  ---
  
  