Answers.Body: <p>Might be easiest to update the database is_default field. Works for me on a 4.6 site:</p>
  
  <pre><code>update civicrm_option_value set is_default=0 where option_group_id=26 and name='Scheduled';
  update civicrm_option_value set is_default=1 where option_group_id=26 and name='Completed';
  </code></pre>
  
  <p>You may need to change the 26 but it's a stock option group. To confirm first can do:</p>
  
  <pre><code>select id from civicrm_option_group where name='activity_status';
  </code></pre>
  
  <p>or go to admin - system settings - option groups and see what the id in the link is. Ideally you'd be able to set default value on that screen but it doesn't seem to offer it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-25T12:26:41.263Z
Answers.Text: Thanks - an interesting suggestion and one that should survive a release update, I guess.
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-25T12:51:11.733Z
Answers.Text: Yes, if you check after the update? The database file properties might change in an update.
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-25T12:57:32.250Z
Answers.Text: Tried this idea and it works. I am surprised that the option_group_id would change between releases though - or am I not understanding something?
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-24T22:57:54.173Z
Answers.LastActivityDate: 2016-09-24T22:57:54.173Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>You can use the buildForm hook on an activity to check if the activity belongs to a case (in which case <code>case_id</code> will not be empty I think) and then set the default status to Completed. </p>
  
  <p>There is an example here, although it sets different statuses for different types it basically does the same thing. Copy and change I would say :-): <a href="https://github.com/PUMNL/nl.pum.casestatus" rel="nofollow">https://github.com/PUMNL/nl.pum.casestatus</a>
  And it is developed for CiviCRM 4.4...</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-25T12:27:21.407Z
Answers.Text: Thanks for the amazingly fast response!  Which was about 3 or 4 minutes...
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-24T12:45:36.667Z
Answers.LastActivityDate: 2016-09-24T12:45:36.667Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>You can also use CiviRules: <a href="https://civicrm.org/extensions/civirules" rel="nofollow noreferrer">https://civicrm.org/extensions/civirules</a></p>
  
  <p>You can set a trigger when a case activity is saved, that the status always changed to "Completed."</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-13T18:20:58.897Z
Answers.LastActivityDate: 2017-07-13T18:20:58.897Z
Answers.UserDisplayName: Kristine
Body: <p>A couple of clients would like to use CiviCase and both of them have very unstructured cases, so a timeline or a sequence is not appropriate. So I have created a case without a timeline or sequence but... when an activity is added to such a case it defaults to a status of 'Scheduled'.  Both of my clients want to normally record activities after the fact, so for them the status should default to 'Completed'. I don't see how this can be done in the UI.  Can anyone either tell me how this can be done with the UI or in the code?  If it can't be done in the UI then adding a default status for new case activities seems like a desirable feature.</p>
  
Tags: <civicase><4.7><4.6><activity>
Title: How to make status always 'Completed' for activities added to a case?
ThreadText: # How to make status always 'Completed' for activities added to a case?
  
  (Asked by: username_0 on 2016-09-24)
  
  A couple of clients would like to use CiviCase and both of them have very unstructured cases, so a timeline or a sequence is not appropriate. So I have created a case without a timeline or sequence but... when an activity is added to such a case it defaults to a status of 'Scheduled'. Both of my clients want to normally record activities after the fact, so for them the status should default to 'Completed'. I don't see how this can be done in the UI. Can anyone either tell me how this can be done with the UI or in the code? If it can't be done in the UI then adding a default status for new case activities seems like a desirable feature.
  
  **Tags:** civicase, 4.7, 4.6, activity
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-09-24. Score: 8
  
  Might be easiest to update the database is\_default field. Works for me on a 4.6 site:
  
  ```
  update civicrm_option_value set is_default=0 where option_group_id=26 and name='Scheduled';
  update civicrm_option_value set is_default=1 where option_group_id=26 and name='Completed';
  
  ```
  
  You may need to change the 26 but it's a stock option group. To confirm first can do:
  
  ```
  select id from civicrm_option_group where name='activity_status';
  
  ```
  
  or go to admin - system settings - option groups and see what the id in the link is. Ideally you'd be able to set default value on that screen but it doesn't seem to offer it.
  
  > **Comments:**
  > **username_0**: Thanks - an interesting suggestion and one that should survive a release update, I guess.  
  > **username_2**: Yes, if you check after the update? The database file properties might change in an update.  
  > **username_0**: Tried this idea and it works. I am surprised that the option_group_id would change between releases though - or am I not understanding something?  
  
  ---
  
  ### Answer by username_2 on 2016-09-24. Score: 4
  
  You can use the buildForm hook on an activity to check if the activity belongs to a case (in which case `case_id` will not be empty I think) and then set the default status to Completed.
  
  There is an example here, although it sets different statuses for different types it basically does the same thing. Copy and change I would say :-): <https://github.com/PUMNL/nl.pum.casestatus>
  And it is developed for CiviCRM 4.4...
  
  > **Comments:**
  > **username_0**: Thanks for the amazingly fast response!  Which was about 3 or 4 minutes...  
  
  ---
  
  ### Answer by username_3 on 2017-07-13. Score: 3
  
  You can also use CiviRules: <https://civicrm.org/extensions/civirules>
  
  You can set a trigger when a case activity is saved, that the status always changed to "Completed."
  
  
  ---
  
  