Answers.Body: <p>Was missing: 
  <code>INSERT INTO civicrm_case_activity (
                              case_id,
                              activity_id
                          )
                          VALUES(
                              CIVICRM_CASE_ID,
                              CIVICRM_ACTIVITY_ID
                          );</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-20T23:11:40.820Z
Answers.Text: Don't forget to mark this answer as the correct one if it is the final answer!
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-24T16:00:23.843Z
Answers.LastActivityDate: 2016-06-24T16:00:23.843Z
Answers.UserDisplayName: Adam
Body: <p>Identical issue to: <a href="https://forum.civicrm.org/index.php?topic=32904.msg140249#msg140249" rel="nofollow">https://forum.civicrm.org/index.php?topic=32904.msg140249#msg140249</a> which was never solved. Manually inserted a case with all of the tables mentioned in the post, yet it doesn't appear under job search in CiviCRM. They show in the database, but the GUI is blank. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-24T15:29:56.487Z
Comments.Text: Can you please add more detail, like some example data that is in the database? Otherwise it is extremely hard to answer your question, I would just be guessing. And also the CiviCRM version and CMS please?
Comments.UserDisplayName: ErikH - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-24T15:46:00.987Z
Comments.Text: `-- Create CiviCRM case
        INSERT INTO civicrm_case (
         case_type_id,
         subject,
         start_date,
         end_date,
         status_id,
         is_deleted
        )
        VALUES(
         CIVICRM_CASE_TYPE_ID,
         SessionId,
         ACTIVITY_DATE_TIME,
         ACTIVITY_DATE_TIME,
         2, -- Completed
         0 -- Not deleted
        );
  
        SELECT LAST_INSERT_ID() INTO CIVICRM_CASE_ID;`
Comments.UserDisplayName: Adam
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-24T15:46:11.020Z
Comments.Text: `-- Create case start activity
  
        INSERT INTO civicrm_activity (
         activity_type_id,
         activity_date_time,
         status_id,
         priority_id,
         is_deleted,
         is_test,
         is_auto,
         is_current_revision
        )
        VALUES(
         148,
         ACTIVITY_DATE_TIME,
         2, -- Completed
         2,
         0,
         0,
         0,
         1
        );`
Comments.UserDisplayName: Adam
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-24T15:46:16.457Z
Comments.Text: `-- Create case end activity
  
        INSERT INTO civicrm_activity (
         activity_type_id,
         activity_date_time,
         status_id,
         priority_id,
         is_deleted,
         is_test,
         is_auto,
         is_current_revision
        )
        VALUES(
         13,
         ACTIVITY_DATE_TIME,
         2, -- Completed
         2,
         0,
         0,
         0,
         1
        );`
Comments.UserDisplayName: Adam
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-24T15:46:33.207Z
Comments.Text: `-- Set case owner
        INSERT INTO civicrm_case_contact (
         case_id,
         contact_id
        )
        VALUES (
         CIVICRM_CASE_ID,
         CIVICRM_CONTACT_ID
        );`
Comments.UserDisplayName: Adam
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-24T15:47:14.380Z
Comments.Text: The version if Drupal, and latest CiviCRM. I can see some views in the database, but regenerating them hasn't made much difference.
Comments.UserDisplayName: Adam
Tags: <civicase><mysql>
Title: Problem with imported case activities not appearing in the case record
ThreadText: # Problem with imported case activities not appearing in the case record
  
  (Asked by: username_0 on 2016-06-24)
  
  Identical issue to: <https://forum.civicrm.org/index.php?topic=32904.msg140249#msg140249> which was never solved. Manually inserted a case with all of the tables mentioned in the post, yet it doesn't appear under job search in CiviCRM. They show in the database, but the GUI is blank.
  
  **Tags:** civicase, mysql
  
  > **Comments:**
  > **username_1**: Can you please add more detail, like some example data that is in the database? Otherwise it is extremely hard to answer your question, I would just be guessing. And also the CiviCRM version and CMS please?  
  > **username_0**: `-- Create CiviCRM case       INSERT INTO civicrm_case (        case_type_id,        subject,        start_date,        end_date,        status_id,        is_deleted       )       VALUES(        CIVICRM_CASE_TYPE_ID,        SessionId,        ACTIVITY_DATE_TIME,        ACTIVITY_DATE_TIME,        2, -- Completed        0 -- Not deleted       );        SELECT LAST_INSERT_ID() INTO CIVICRM_CASE_ID;`  
  > **username_0**: `-- Create case start activity        INSERT INTO civicrm_activity (        activity_type_id,        activity_date_time,        status_id,        priority_id,        is_deleted,        is_test,        is_auto,        is_current_revision       )       VALUES(        148,        ACTIVITY_DATE_TIME,        2, -- Completed        2,        0,        0,        0,        1       );`  
  > **username_0**: `-- Create case end activity        INSERT INTO civicrm_activity (        activity_type_id,        activity_date_time,        status_id,        priority_id,        is_deleted,        is_test,        is_auto,        is_current_revision       )       VALUES(        13,        ACTIVITY_DATE_TIME,        2, -- Completed        2,        0,        0,        0,        1       );`  
  > **username_0**: `-- Set case owner       INSERT INTO civicrm_case_contact (        case_id,        contact_id       )       VALUES (        CIVICRM_CASE_ID,        CIVICRM_CONTACT_ID       );`  
  > **username_0**: The version if Drupal, and latest CiviCRM. I can see some views in the database, but regenerating them hasn't made much difference.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-06-24. Score: 0 | Accepted answer
  
  Was missing:
  `INSERT INTO civicrm_case_activity (
  case_id,
  activity_id
  )
  VALUES(
  CIVICRM_CASE_ID,
  CIVICRM_ACTIVITY_ID
  );`
  
  > **Comments:**
  > **username_2**: Don't forget to mark this answer as the correct one if it is the final answer!  
  
  ---
  
  