Answers.Body: <p>Another alternative might be to use the CiviRules extension, and develop your own action that prepopulates cases upon creation?</p>
  
  <p>Check for <a href="https://civicrm.org/extensions/civirules" rel="nofollow noreferrer">https://civicrm.org/extensions/civirules</a> the extension and <a href="https://docs.civicrm.org/civirules/en/latest/create-your-own-introduction/" rel="nofollow noreferrer">https://docs.civicrm.org/civirules/en/latest/create-your-own-introduction/</a> for documentation on developing your own actions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-07T14:37:22.030Z
Answers.LastActivityDate: 2018-05-07T14:37:22.030Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>We often have batches of six to eight related cases which have much of the same content (relationships, custom fields, activities). I would like to generate new cases by cloning an existing case multiple times. Before I embark on writing a new extension, has anyone already done something like this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-03T20:28:51.063Z
Comments.Text: I dont really understand your question. You can create a case types which preloads a bunch of activities and roles (relationships). Is that waht you mean?
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-04T07:54:01.280Z
Comments.Text: Thanks. Yes, we use case types extensively. These give you the structure for a new case, and a standardised set of activities, but it's essentially an empty case, ready for data entry. What I want to do is clone a case, complete with all the data (roles data, custom field contents, activities).
  
  The obvious solution is an extension which creates a new empty case and then copies all the data from the source case to the new case, but I would need to hard-code the copying function for each different case type. I was hoping that there might be a better (ie more generic) way?
Comments.UserDisplayName: Jern
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-07T18:37:50.263Z
Comments.Text: I would say have a look at the solution ErikH has mentioned.
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Tags: <civicase>
Title: How to duplicate a case
ThreadText: # How to duplicate a case
  
  (Asked by: username_0 on 2018-05-03)
  
  We often have batches of six to eight related cases which have much of the same content (relationships, custom fields, activities). I would like to generate new cases by cloning an existing case multiple times. Before I embark on writing a new extension, has anyone already done something like this?
  
  **Tags:** civicase
  
  > **Comments:**
  > **username_1**: I dont really understand your question. You can create a case types which preloads a bunch of activities and roles (relationships). Is that waht you mean?  
  > **username_0**: Thanks. Yes, we use case types extensively. These give you the structure for a new case, and a standardised set of activities, but it's essentially an empty case, ready for data entry. What I want to do is clone a case, complete with all the data (roles data, custom field contents, activities).  The obvious solution is an extension which creates a new empty case and then copies all the data from the source case to the new case, but I would need to hard-code the copying function for each different case type. I was hoping that there might be a better (ie more generic) way?  
  > **username_1**: I would say have a look at the solution ErikH has mentioned.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-05-07. Score: 3 | Accepted answer
  
  Another alternative might be to use the CiviRules extension, and develop your own action that prepopulates cases upon creation?
  
  Check for <https://civicrm.org/extensions/civirules> the extension and <https://docs.civicrm.org/civirules/en/latest/create-your-own-introduction/> for documentation on developing your own actions.
  
  
  ---
  
  