Compare the main issue assignee and sub-task assignees

Hello, I am able to do a report that count sub-tasks that’s not done when a sprint close with the below calculated formula.

[Measures].[Transitions to],
[Transition Field].[Sprint status],
[Sprint Status].[Closed],
[Issue Type].[Sub-task],
– An issue was in a sprint at closing
[Issue Sprint Status Change].[Active => Closed]

However, I just want to count the unfinished sub-tasks whose assignee is different than the main issue’s assignee. Is there anyway I can put that condition into the above formula.
Thank you in advance,
Vu.

Hi @Vu_Tran

Here, you could first import “Parent assignee” field as the inherited field dimension which would get the assignee from the main issue to each sub-task.
Try these advanced settings:

[jira.customfield_assignee_p]
name = "Parent assignee" 
data_type = "string"
dimension = true
update_from_issue_key = "parent_issue_key"
javascript_code = '''
if(issue.fields.assignee ) {
   issue.fields.customfield_assignee_p = issue.fields.assignee.displayName;
}
'''

In similar way define another field “Current assignee” in advanced settings and import it also as property and dimension from the import options page.

[jira.customfield_curass]
name = "Current assignee" 
data_type = "string"
dimension = true
javascript_code = '''
if(issue.fields.assignee ) {
   issue.fields.customfield_curass = issue.fields.assignee.displayName;
}
'''

Next, you could create a calculated measure using this formula:

Sum(
DescendantsSet([Parent assignee].CurrentHierarchyMember,[Parent assignee].[Parent assignee]),
  Sum(
  Filter(
  DescendantsSet([Current assignee].CurrentHierarchyMember,[Current assignee].[Current assignee]),
  [Current assignee].CurrentMember.name <> [Parent assignee].CurrentMember.name
  ),
    (
      [Measures].[Transitions to],
      [Transition Field].[Sprint status],
      [Sprint Status].[Closed],
      [Issue Type].[Sub-task],
      --An issue was in a sprint at closing
      [Issue Sprint Status Change].[Active => Closed]
    )
  )
)

It is slower than your first code, but it would know how to find the sub-tasks whose assignee is different than the main issue’s assignee.

Martins / eazyBI