Answers.Body: <p>I got something close to this search working starting from a related contacts search and pulling in case id from the relationshop</p>
  <p><a href="https://i.sstatic.net/y068t.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/y068t.png" alt="enter image description here" /></a></p>
  <p>And then filtering the relationship contact for current user</p>
  <p><a href="https://i.sstatic.net/wFeKr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wFeKr.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-05T00:19:20.673Z
Answers.Text: Good approach Craig, thanks!
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-04T12:01:24.920Z
Answers.LastActivityDate: 2023-03-04T12:01:24.920Z
Answers.UserDisplayName: Craig Almond
Answers.Body: <p>Is it a default install you're playing with - the role Case Coordinator - that role in a default install is never the case manager - it's either Homeless Services Coordinator or Senior Services Coordinator. So that would explain blanks.</p>
  <p>Then for your &quot;current user&quot; part, you can do it if they are listed on the given activity in some role, either reporter/assignee/target. Because then the Activity Contact - Contact ID is available and you can equate it to &quot;select current user&quot;.</p>
  <p><a href="https://i.sstatic.net/05Hiq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/05Hiq.png" alt="enter image description here" /></a></p>
  <p>But otherwise I don't think the case-contact-role-contact-id is available. But what you could do is leave that part out, then create a form for the search display and have contact display name as a filter. It just wouldn't automatically be <em>their</em> name, they'd have to type it in the filter.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-04T16:56:53.623Z
Answers.Text: Thanks Demerit. I had "Select Current User" working for Activities just fine, had hoped for a way to do it w. Case roles. Last I heard @Coleman was switching focus to Afform so I'm afraid this won't get added any time soon 
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-03T20:31:49.057Z
Answers.LastActivityDate: 2022-02-03T20:31:49.057Z
Answers.UserDisplayName: Demerit
Body: <p>The search specified below (image and Query Info &gt; API below) works brilliantly. It shows all activities and their corresponding cases where the Activity is &quot;open&quot; (i.e. not Completed nor a couple of other Activity statuses). The one refinement it needs is to limit the results &quot;My Cases&quot; (something like requiring that result column &quot;Case Clients - Contact Case Roles: Contact (Near side) Display Name&quot; equal Extra &gt; Current User ID). The use case is a My Open Activities in Cases dashlet.</p>
  <p>I've tried adding conditions under &quot;With (optional) Contact Case Roles&quot; but in all cases the result is that the column &quot;Case Clients - Contact Case Roles: Contact (Near side) Display Name&quot; comes back blank.</p>
  <p>Any guidance on how to approach this appreciated.</p>
  <p><a href="https://i.sstatic.net/a22p6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/a22p6.png" alt="enter image description here" /></a></p>
  <p><code>{ &quot;version&quot;: 4, &quot;select&quot;: [ &quot;Case_CaseActivity_Activity_01.activity_date_time&quot;, &quot;Case_CaseActivity_Activity_01.created_date&quot;, &quot;Case_CaseActivity_Activity_01.status_id:label&quot;, &quot;Case_CaseActivity_Activity_01.activity_type_id:label&quot;, &quot;Case_CaseActivity_Activity_01.subject&quot;, &quot;case_type_id:label&quot;, &quot;id&quot;, &quot;Case_CaseContact_Contact_01.display_name&quot;, &quot;Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.near_contact_id.display_name&quot; ], &quot;orderBy&quot;: [], &quot;where&quot;: [ [ &quot;case_type_id:name&quot;, &quot;IN&quot;, [ &quot;college_assistance_fund&quot; ] ], [ &quot;status_id:name&quot;, &quot;!=&quot;, &quot;Closed&quot; ], [ &quot;is_deleted&quot;, &quot;=&quot;, false ], [ &quot;Case_CaseActivity_Activity_01.status_id:name&quot;, &quot;NOT IN&quot;, [ &quot;Cancelled&quot;, &quot;No Followup&quot;, &quot;Completed&quot; ] ] ], &quot;groupBy&quot;: [], &quot;join&quot;: [ [ &quot;Contact AS Case_CaseContact_Contact_01&quot;, &quot;INNER&quot;, &quot;CaseContact&quot;, [ &quot;id&quot;, &quot;=&quot;, &quot;Case_CaseContact_Contact_01.case_id&quot; ] ], [ &quot;Activity AS Case_CaseActivity_Activity_01&quot;, &quot;INNER&quot;, &quot;CaseActivity&quot;, [ &quot;id&quot;, &quot;=&quot;, &quot;Case_CaseActivity_Activity_01.case_id&quot; ] ], [ &quot;Case AS Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01&quot;, &quot;LEFT&quot;, &quot;RelationshipCache&quot;, [ &quot;Case_CaseContact_Contact_01.id&quot;, &quot;=&quot;, &quot;Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.far_contact_id&quot; ], [ &quot;Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.near_relation:name&quot;, &quot;=&quot;, &quot;\&quot;Case Coordinator\&quot;&quot; ], [ &quot;Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.is_active&quot;, &quot;=&quot;, true ] ] ], &quot;having&quot;: []</code></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-27T00:51:15.733Z
Comments.Text: After posting I went on to change the 'With (optional)" to "With (required)" since that's more accurate for a "My Cases" filter. That did not change the behavior when I try to add a filter by coordinator.
Comments.UserDisplayName: wil_SRQ
Tags: <civicase><searchkit>
Title: Limit search of Activities to Cases for which I am the coordinator
ThreadText: # Limit search of Activities to Cases for which I am the coordinator
  
  (Asked by: username_0 on 2022-01-26)
  
  The search specified below (image and Query Info > API below) works brilliantly. It shows all activities and their corresponding cases where the Activity is "open" (i.e. not Completed nor a couple of other Activity statuses). The one refinement it needs is to limit the results "My Cases" (something like requiring that result column "Case Clients - Contact Case Roles: Contact (Near side) Display Name" equal Extra > Current User ID). The use case is a My Open Activities in Cases dashlet.
  
  I've tried adding conditions under "With (optional) Contact Case Roles" but in all cases the result is that the column "Case Clients - Contact Case Roles: Contact (Near side) Display Name" comes back blank.
  
  Any guidance on how to approach this appreciated.
  
  [![enter image description here](https://i.sstatic.net/a22p6.png)](https://i.sstatic.net/a22p6.png)
  
  `{ "version": 4, "select": [ "Case_CaseActivity_Activity_01.activity_date_time", "Case_CaseActivity_Activity_01.created_date", "Case_CaseActivity_Activity_01.status_id:label", "Case_CaseActivity_Activity_01.activity_type_id:label", "Case_CaseActivity_Activity_01.subject", "case_type_id:label", "id", "Case_CaseContact_Contact_01.display_name", "Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.near_contact_id.display_name" ], "orderBy": [], "where": [ [ "case_type_id:name", "IN", [ "college_assistance_fund" ] ], [ "status_id:name", "!=", "Closed" ], [ "is_deleted", "=", false ], [ "Case_CaseActivity_Activity_01.status_id:name", "NOT IN", [ "Cancelled", "No Followup", "Completed" ] ] ], "groupBy": [], "join": [ [ "Contact AS Case_CaseContact_Contact_01", "INNER", "CaseContact", [ "id", "=", "Case_CaseContact_Contact_01.case_id" ] ], [ "Activity AS Case_CaseActivity_Activity_01", "INNER", "CaseActivity", [ "id", "=", "Case_CaseActivity_Activity_01.case_id" ] ], [ "Case AS Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01", "LEFT", "RelationshipCache", [ "Case_CaseContact_Contact_01.id", "=", "Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.far_contact_id" ], [ "Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.near_relation:name", "=", "\"Case Coordinator\"" ], [ "Case_CaseContact_Contact_01_Contact_RelationshipCache_Case_01.is_active", "=", true ] ] ], "having": []`
  
  **Tags:** civicase, searchkit
  
  > **Comments:**
  > **username_0**: After posting I went on to change the 'With (optional)" to "With (required)" since that's more accurate for a "My Cases" filter. That did not change the behavior when I try to add a filter by coordinator.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-03-04. Score: 2 | Accepted answer
  
  I got something close to this search working starting from a related contacts search and pulling in case id from the relationshop
  
  [![enter image description here](https://i.sstatic.net/y068t.png)](https://i.sstatic.net/y068t.png)
  
  And then filtering the relationship contact for current user
  
  [![enter image description here](https://i.sstatic.net/wFeKr.png)](https://i.sstatic.net/wFeKr.png)
  
  > **Comments:**
  > **username_0**: Good approach username_1, thanks!  
  
  ---
  
  ### Answer by username_2 on 2022-02-03. Score: 2
  
  Is it a default install you're playing with - the role Case Coordinator - that role in a default install is never the case manager - it's either Homeless Services Coordinator or Senior Services Coordinator. So that would explain blanks.
  
  Then for your "current user" part, you can do it if they are listed on the given activity in some role, either reporter/assignee/target. Because then the Activity Contact - Contact ID is available and you can equate it to "select current user".
  
  [![enter image description here](https://i.sstatic.net/05Hiq.png)](https://i.sstatic.net/05Hiq.png)
  
  But otherwise I don't think the case-contact-role-contact-id is available. But what you could do is leave that part out, then create a form for the search display and have contact display name as a filter. It just wouldn't automatically be *their* name, they'd have to type it in the filter.
  
  > **Comments:**
  > **username_0**: Thanks username_2. I had "Select Current User" working for Activities just fine, had hoped for a way to do it w. Case roles. Last I heard @Coleman was switching focus to Afform so I'm afraid this won't get added any time soon   
  
  ---
  
  