Answers.Body: <p>It's a bug. On line 1804 of CRM/Case/BAO/Case.php there is the following test ...</p>
  
  <pre><code>   if (isset($dao-&gt;caseId) || $dao-&gt;rel_contact_id != $contactId) {
  </code></pre>
  
  <p>Observing how the function is called, the Case Id will always be set, so the condition is always true and the else part is never executed.</p>
  
  <p>Changing the condition to ...</p>
  
  <pre><code>   if ($dao-&gt;rel_contact_id != $contactId) {
  </code></pre>
  
  <p>fixes the behaviour.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-20T07:20:36.090Z
Answers.Text: Great find! Have you submitted a bug report at issues.CiviCRM.org?
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-20T11:30:08.677Z
Answers.Text: See issue CRM-18445 and PR https://github.com/civicrm/civicrm-core/pull/8186
Answers.UserDisplayName: Ken West
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-20T03:34:51.567Z
Answers.LastActivityDate: 2016-04-20T03:34:51.567Z
Answers.UserDisplayName: Ken West
Answers.Body: <p>It doesn't send an email. There's a couple things like that - e.g. merges show the reported by as the client. I'd probably say it's just never been a high enough priority for anyone to look into.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-20T02:07:04.570Z
Answers.LastActivityDate: 2016-04-20T02:07:04.570Z
Answers.UserDisplayName: Demerit
Body: <p>I can reproduce this on the 4.7 demo.</p>
  
  <p>I create a case of type 'Adult Day Care Referral' for client Rebekah Adams.</p>
  
  <p>Using the civicrm/contact/view/case screen, I assign the role 'Health Services Coordinator' to Junko Adams. I use the 'pencil' icon to do this.</p>
  
  <p>The role is assigned to Junko Adams, but the 'Assign Case Role' activity is assigned to Rebekah Adams (the client) and the subject is 'Health Services Coordinator is : Dr. Rebekah Adams'.</p>
  
  <p>That's confusing, and if an email is sent to the client, that could be nasty.</p>
  
Tags: <civicase>
Title: In 4.7 the activity 'Assign Case Role' is assigned to the client: is this a bug?
ThreadText: # In 4.7 the activity 'Assign Case Role' is assigned to the client: is this a bug?
  
  (Asked by: username_0 on 2016-04-18)
  
  I can reproduce this on the 4.7 demo.
  
  I create a case of type 'Adult Day Care Referral' for client Rebekah Adams.
  
  Using the civicrm/contact/view/case screen, I assign the role 'Health Services Coordinator' to Junko Adams. I use the 'pencil' icon to do this.
  
  The role is assigned to Junko Adams, but the 'Assign Case Role' activity is assigned to Rebekah Adams (the client) and the subject is 'Health Services Coordinator is : Dr. Rebekah Adams'.
  
  That's confusing, and if an email is sent to the client, that could be nasty.
  
  **Tags:** civicase
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-04-20. Score: 4
  
  It's a bug. On line 1804 of CRM/Case/BAO/Case.php there is the following test ...
     if (isset($dao->caseId) || $dao->rel_contact_id != $contactId) {
  
  Observing how the function is called, the Case Id will always be set, so the condition is always true and the else part is never executed.
  Changing the condition to ...
     if ($dao->rel_contact_id != $contactId) {
  
  fixes the behaviour.
  
  > **Comments:**
  > **username_1**: Great find! Have you submitted a bug report at issues.CiviCRM.org?  
  > **username_0**: See issue CRM-18445 and PR https://github.com/civicrm/civicrm-core/pull/8186  
  
  ---
  
  ### Answer by username_2 on 2016-04-20. Score: 0
  
  It doesn't send an email. There's a couple things like that - e.g. merges show the reported by as the client. I'd probably say it's just never been a high enough priority for anyone to look into.
  
  
  ---
  
  