Answers.Body: <p>While I can see this is an older issue I have the same problem in Drupal 7.41 and Civi 4.6.10. I found that this is no longer an issue in Drupal 7 Civi 4.7.27 (I just verified on the demo site!) If we aren't able to upgrade in the near future, I'll get around to looking at the log query (hopefully it doesn't come to that ;)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-11T17:45:12.517Z
Answers.LastActivityDate: 2017-12-11T17:45:12.517Z
Answers.UserDisplayName: RayWright
Body: <p>This seems like a bug.  I encountered it on Joomla with 4.6.8 and reproduced on the demo server.</p>
  
  <p>If I create a case and change the status to "Urgent", then use the API (including API explorer), it seems to filter properly on status_id and is_deleted UNTIL I also add contact_id (Case Client).  Then it returns the case regardless of its status.  (I didn't test whether it works correctly with is_deleted).</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-17T14:58:31.287Z
Comments.Text: You could turn on CIVICRM_DEBUG_LOG_QUERY and see what the difference in queries is: http://wiki.civicrm.org/confluence/display/CRMDOC/Debugging+for+developers#Debuggingfordevelopers-SettingswhichmodifyCiviCRMbehaviorfordebugging
Comments.UserDisplayName: Demerit
Tags: <api><civicase>
Title: Why doesn't CiviCase API filter by case status when the client is specified?
ThreadText: # Why doesn't CiviCase API filter by case status when the client is specified?
  
  (Asked by: username_0 on 2015-10-10)
  
  This seems like a bug. I encountered it on Joomla with 4.6.8 and reproduced on the demo server.
  
  If I create a case and change the status to "Urgent", then use the API (including API explorer), it seems to filter properly on status\_id and is\_deleted UNTIL I also add contact\_id (Case Client). Then it returns the case regardless of its status. (I didn't test whether it works correctly with is\_deleted).
  
  **Tags:** api, civicase
  
  > **Comments:**
  > **username_1**: You could turn on CIVICRM_DEBUG_LOG_QUERY and see what the difference in queries is: http://wiki.civicrm.org/confluence/display/CRMDOC/Debugging+for+developers#Debuggingfordevelopers-SettingswhichmodifyCiviCRMbehaviorfordebugging  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-12-11. Score: 2
  
  While I can see this is an older issue I have the same problem in Drupal 7.41 and Civi 4.6.10. I found that this is no longer an issue in Drupal 7 Civi 4.7.27 (I just verified on the demo site!) If we aren't able to upgrade in the near future, I'll get around to looking at the log query (hopefully it doesn't come to that ;)
  
  
  ---
  
  