Answers.Body: <p>Search - Custom Searches - Activity Search supports case id at least already, but the display template explicitly doesn't show it, although it uses it to create links.</p>
  
  <p>Doesn't look like it would be difficult to modify Activity Search. You might also be able to modify the Activity CiviReport similarly. For Activity Search, it would be something like:</p>
  
  <pre><code>1) In CRM/Contact/Form/Search/Custom/ActivitySearch.php:
  (a) Near the top where it defines the columns, add your columns labels as desired.
  (b) In function all(), add the case-related fields to the select definition.
  (c) In function from(), add a left join on civicrm_case.
  
  2) In templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl, display your new columns as desired.
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-11T01:42:55.627Z
Answers.LastActivityDate: 2016-08-11T01:42:55.627Z
Answers.UserDisplayName: Demerit
Body: <p>Is it possible and what's the best way to add case fields (e.g. case type) to an activity report whilst still ensuring civi can be updated easily?</p>
  
  <p>I'd imagine those aren't default options because not all activities are related to a case.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-10T04:32:03.950Z
Comments.Text: Maybe if you can describe what you'd like the final report to look like? It's not quite clear what you're asking.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-10T22:26:35.603Z
Comments.Text: @Demerit I'm not sure what else I can add to clarify. Basically, for those activities that are related to a case, I want case fields like case type and start date or whatever listed alongside that activity in the activity report.
Comments.UserDisplayName: inteja
Tags: <civireport><civicase><activity>
Title: How to add case fields to activity report?
ThreadText: # How to add case fields to activity report?
  
  (Asked by: username_0 on 2016-08-10)
  
  Is it possible and what's the best way to add case fields (e.g. case type) to an activity report whilst still ensuring civi can be updated easily?
  
  I'd imagine those aren't default options because not all activities are related to a case.
  
  **Tags:** civireport, civicase, activity
  
  > **Comments:**
  > **username_1**: Maybe if you can describe what you'd like the final report to look like? It's not quite clear what you're asking.  
  > **username_0**: @username_1 I'm not sure what else I can add to clarify. Basically, for those activities that are related to a case, I want case fields like case type and start date or whatever listed alongside that activity in the activity report.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-08-11. Score: 0 | Accepted answer
  
  Search - Custom Searches - Activity Search supports case id at least already, but the display template explicitly doesn't show it, although it uses it to create links.
  Doesn't look like it would be difficult to modify Activity Search. You might also be able to modify the Activity CiviReport similarly. For Activity Search, it would be something like:
  1) In CRM/Contact/Form/Search/Custom/ActivitySearch.php:
  (a) Near the top where it defines the columns, add your columns labels as desired.
  (b) In function all(), add the case-related fields to the select definition.
  (c) In function from(), add a left join on civicrm_case.
  
  2) In templates/CRM/Contact/Form/Search/Custom/ActivitySearch.tpl, display your new columns as desired.
  
  
  ---
  
  