Answers.Body: <p>You probably do not have an Open Case activity configured for your case type.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-05T07:52:15.663Z
Answers.LastActivityDate: 2019-03-05T07:52:15.663Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>Answer (thanks to @ErikH and @Demerit): the problem was that the case type did not have an Open Case activity in its standard timeline (presumably I had deleted it). Anyway, I added the Open Case activity to the standard timeline, and subsequently-created cases have been fine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-17T09:38:32.857Z
Answers.Text: glad you found your issue!
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-01T10:06:26.873Z
Answers.LastActivityDate: 2019-03-01T10:06:26.873Z
Answers.UserDisplayName: Jern
Body: <p>I'm using the REST interface and the create case API to create a new case. The case is created, but no activities. In particular, no "Open Case" activity is created as I would have expected. No entry is created in the civicrm_case_activity table. As a consequence (or maybe this is just a coincidence), the Case does not show up in search results. If I edit the case, then a Change Case entry is created in the civicrm_case_activity table and the case then appears in search reports.</p>
  
  <p>Do I need to explicitly create an Open Case activity? For example by chaining api.Activity.create json on to the Case create json? Thanks.</p>
  
  <p>CiviCRM 5.10.4
  Joomla 3.9.2
  PHP 7.0.33</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T14:08:08.643Z
Comments.Text: I assume there is an Open Case activity in the definition of your case type?
Comments.UserDisplayName: ErikH - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T15:37:11.690Z
Comments.Text: Erik might have a good point. It works for me ok using `curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d @foo.txt http://url/sites/all/modules/civicrm/extern/rest.php` with foo.txt containing `entity=Case&action=create&api_key=my-user-key&key=the-site-key&json={"contact_id":"user_contact_id","subject":"test","case_type_id":"housing_support"}`. The url would be different for joomla - mine is drupal.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T16:49:09.300Z
Comments.Text: Yup. That was it. In fact I needed to include the Open Case activity in the case type and also in its standard timeline. Thank you!
Comments.UserDisplayName: Jern
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-28T19:07:17.030Z
Comments.Text: @ErikH-CiviCooP Would you like to make that your answer, so I can accept it? Otherwise I will write an answer. Thanks again.
Comments.UserDisplayName: Jern
Tags: <api><civicase><activities><chaining>
Title: Create Case using API via REST - no "Open Case" activity created
ThreadText: # Create Case using API via REST - no "Open Case" activity created
  
  (Asked by: username_0 on 2019-02-28)
  
  I'm using the REST interface and the create case API to create a new case. The case is created, but no activities. In particular, no "Open Case" activity is created as I would have expected. No entry is created in the civicrm\_case\_activity table. As a consequence (or maybe this is just a coincidence), the Case does not show up in search results. If I edit the case, then a Change Case entry is created in the civicrm\_case\_activity table and the case then appears in search reports.
  
  Do I need to explicitly create an Open Case activity? For example by chaining api.Activity.create json on to the Case create json? Thanks.
  
  CiviCRM 5.10.4
  Joomla 3.9.2
  PHP 7.0.33
  
  **Tags:** api, civicase, activities, chaining
  
  > **Comments:**
  > **username_1**: I assume there is an Open Case activity in the definition of your case type?  
  > **username_2**: Erik might have a good point. It works for me ok using `curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d @foo.txt http://url/sites/all/modules/civicrm/extern/rest.php` with foo.txt containing `entity=Case&action=create&api_key=my-user-key&key=the-site-key&json={"contact_id":"user_contact_id","subject":"test","case_type_id":"housing_support"}`. The url would be different for joomla - mine is drupal.  
  > **username_0**: Yup. That was it. In fact I needed to include the Open Case activity in the case type and also in its standard timeline. Thank you!  
  > **username_0**: @username_1 Would you like to make that your answer, so I can accept it? Otherwise I will write an answer. Thanks again.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-03-05. Score: 2 | Accepted answer
  
  You probably do not have an Open Case activity configured for your case type.
  
  
  ---
  
  ### Answer by username_0 on 2019-03-01. Score: 4
  
  Answer (thanks to @username_1 and @username_2): the problem was that the case type did not have an Open Case activity in its standard timeline (presumably I had deleted it). Anyway, I added the Open Case activity to the standard timeline, and subsequently-created cases have been fine.
  
  > **Comments:**
  > **username_1**: glad you found your issue!  
  
  ---
  
  