Hi,
Is there any way to display DISTINCT cases owned by different teams and their members using Fetch XML? A user may belong to multiple teams.
The need is to display all these cases in the SSRS report. I am able to pull the cases and have them grouped by "Team Name" but as users belong to multiple teams so a single case is counted multiple times.
Here is the sample of Fetch XML query:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="incident">
<attribute name="title" />
<attribute name="ticketnumber" />
<attribute name="createdon" />
<attribute name="incidentid" />
<attribute name="modifiedon" />
<attribute name="statecode" />
<attribute name="ownerid"/>
<attribute name="owninguser" />
<order attribute="title" descending="false" />
<filter type="or">
<condition attribute="ownerid" operator="in" value="@Team" />
<condition entityname="alias_TeamMember" attribute="teamid" operator="in" value="@Team" />
</filter>
<link-entity name="systemuser" from="systemuserid" to="owninguser" link-type="outer" alias="alias_SystemUser">
<link-entity name='teammembership' from='systemuserid' to='systemuserid' visible='false' alias="alias_TeamMember" link-type="outer" intersect='true'>
<link-entity name="team" from="teamid" to="teamid" link-type="outer" alias="alias_team">
<attribute name="name" />
<attribute name="teamid" />
</link-entity>
</link-entity>
</link-entity>
</entity>
</fetch>