Answers.Body: <p>UPDATE: Can do this with an extension using hook_civicrm_alterEntityRefParams. It also magically adds a Case Status filter in the &quot;refine search&quot; dropdown that appears when you start typing a name. See <a href="https://lab.civicrm.org/dev/core/-/issues/2209#note_51075" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/2209#note_51075</a> and <a href="https://github.com/AsylumSeekersCentre/civicrm-moveActivityToAnyCase" rel="nofollow noreferrer">https://github.com/AsylumSeekersCentre/civicrm-moveActivityToAnyCase</a></p>
  <hr />
  <p>While I'd vote to bring the ability to file on a closed case back, or maybe make it a configuration option to allow or not, one workaround is to use the email processor and put the case id in square brackets in the subject (<a href="https://issues.civicrm.org/jira/browse/CRM-21446" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-21446</a>). It will happily file it on a closed case. Information about setting up the email processor is here <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/#autofiling-email-activities-via-emailprocessor" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/#autofiling-email-activities-via-emailprocessor</a></p>
  <p>And if you edit an activity and add the case id in square brackets to the subject and then save, it will file on case, e.g. &quot;this is the subject [case #1234]&quot;</p>
  <p>According to the issue you linked, <a href="https://issues.civicrm.org/jira/browse/CRM-17645" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-17645</a> you should be able to use a hook_civicrm_entityGet in an extension to alter the query, but I'm not sure from those notes that it actually got implemented.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-20T21:31:02.733Z
Answers.Text: What magic is this!!? I didn't know the trick about editing the case subject. It totally still works, should anyone else stumble on this be sure to use the format listed in the jira issue Demerit linked - i.e. [case #12345]
Answers.UserDisplayName: RayWright
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-20T21:33:33.080Z
Answers.Text: It's great to know someone else would benefit from filing on a closed case. Not sure what will work out, but I'm going to look into the hook for maintainability - thanks for that direction.
Answers.UserDisplayName: RayWright
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-21T01:38:03.580Z
Answers.Text: only thing to note for others, perhaps as an edit to the answer, is that for this to work you need to have Inbound Emails set up too - https://www.google.co.nz/search?q=civicrm+inbound+email&oq=civicrm+inbound&aqs=chrome.2.69i57j69i60j0j69i64.6401j0j7&sourceid=chrome&ie=UTF-8. happy for Demerit to cut and paste in his answer
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-21T01:39:00.187Z
Answers.Text: also to note, i would probably support getting that feature back, as D says as an 'opt-in' setting - however I would also note we have many clients using Cases and have never had any request for this so not sure how much usage it would have
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-21T04:16:53.620Z
Answers.Text: @petednz the edit subject and save feature doesn't require it, but yes the email processor requires some setup. I will edit answer.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-20T21:19:22.460Z
Answers.LastActivityDate: 2020-12-01T14:47:24.247Z
Answers.LastEditDate: 2020-12-01T14:47:24.247Z
Answers.UserDisplayName: Demerit
Body: <p>In Civi 4.6, when you filed/moved and activity to a case, you could choose a closed case from the list. In fact, there was a conditional to show closed cases with a strikethrough. In 4.7, <a href="https://github.com/civicrm/civicrm-core/commit/abd06efc426540ed16cb091093f90e13df2579f1#diff-33701fa5cf202f23358bda8d30e2c082" rel="nofollow noreferrer">when everything was moving to EntityRef that little piece was removed</a> and all references to "file on case" assumes the case is open.</p>
  
  <p>While I've been able to track down some lines I could comment out (in the parameters of the addEntityRef) to allow closed cases to populate the list again - that means a custom PHP file. I guess I was wondering if it is predominant that people only file on open cases? The behavior feels strange that you wouldn't want to be able to include (or have an option to on the form itself) closed cases.</p>
  
  <p>Does anyone else file on closed cases and have a different workaround?</p>
  
Tags: <civicase><activities>
Title: Filing activities on closed cases
ThreadText: # Filing activities on closed cases
  
  (Asked by: username_0 on 2018-11-20)
  
  In Civi 4.6, when you filed/moved and activity to a case, you could choose a closed case from the list. In fact, there was a conditional to show closed cases with a strikethrough. In 4.7, [when everything was moving to EntityRef that little piece was removed](https://github.com/civicrm/civicrm-core/commit/abd06efc426540ed16cb091093f90e13df2579f1#diff-33701fa5cf202f23358bda8d30e2c082) and all references to "file on case" assumes the case is open.
  
  While I've been able to track down some lines I could comment out (in the parameters of the addEntityRef) to allow closed cases to populate the list again - that means a custom PHP file. I guess I was wondering if it is predominant that people only file on open cases? The behavior feels strange that you wouldn't want to be able to include (or have an option to on the form itself) closed cases.
  
  Does anyone else file on closed cases and have a different workaround?
  
  **Tags:** civicase, activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-11-20. Score: 2 | Accepted answer
  
  UPDATE: Can do this with an extension using hook\_civicrm\_alterEntityRefParams. It also magically adds a Case Status filter in the "refine search" dropdown that appears when you start typing a name. See <https://lab.civicrm.org/dev/core/-/issues/2209#note_51075> and <https://github.com/AsylumSeekersCentre/civicrm-moveActivityToAnyCase>
  
  ---
  
  While I'd vote to bring the ability to file on a closed case back, or maybe make it a configuration option to allow or not, one workaround is to use the email processor and put the case id in square brackets in the subject (<https://issues.civicrm.org/jira/browse/CRM-21446>). It will happily file it on a closed case. Information about setting up the email processor is here <https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/#autofiling-email-activities-via-emailprocessor>
  
  And if you edit an activity and add the case id in square brackets to the subject and then save, it will file on case, e.g. "this is the subject [case #1234]"
  
  According to the issue you linked, <https://issues.civicrm.org/jira/browse/CRM-17645> you should be able to use a hook\_civicrm\_entityGet in an extension to alter the query, but I'm not sure from those notes that it actually got implemented.
  
  > **Comments:**
  > **username_0**: What magic is this!!? I didn't know the trick about editing the case subject. It totally still works, should anyone else stumble on this be sure to use the format listed in the jira issue username_1 linked - i.e. [case #12345]  
  > **username_0**: It's great to know someone else would benefit from filing on a closed case. Not sure what will work out, but I'm going to look into the hook for maintainability - thanks for that direction.  
  > **username_2**: only thing to note for others, perhaps as an edit to the answer, is that for this to work you need to have Inbound Emails set up too - https://www.google.co.nz/search?q=civicrm+inbound+email&oq=civicrm+inbound&aqs=chrome.2.69i57j69i60j0j69i64.6401j0j7&sourceid=chrome&ie=UTF-8. happy for username_1 to cut and paste in his answer  
  > **username_2**: also to note, i would probably support getting that feature back, as D says as an 'opt-in' setting - however I would also note we have many clients using Cases and have never had any request for this so not sure how much usage it would have  
  > **username_1**: @username_2 the edit subject and save feature doesn't require it, but yes the email processor requires some setup. I will edit answer.  
  
  ---
  
  