Count the number of Components tagged to the issues

Hi, currently we are breakdown main tasks into subtasks based on the tagged components.
Sample Main task is tagged to Component A and Component B, then we will create 2 subtasks
(1 tagged to component A) and (1 tagged to component B). We would like to add in the column if the parent of the subtask is tagged to multiple components. Is this possible?

	                Parent issue components
Subtask 1	2
Subtask 2	3
Subtask 3	4



Hi @Jim

Try creating a new calculated measure using this formula:

CASE WHEN
[Measures].[Issue components] <> "(no component)"
THEN
Len([Measures].[Issue components]) - 
Len(Replace([Measures].[Issue components], ',', ''))
+1
END

If there is a component value at all, this formula will count separator (comma) and add + 1 to the result.

And this code to show the count of parent components:

CASE WHEN
[Issue.Sub-task].[Sub-task].Getmemberbykey(
[Issue].CurrentHierarchyMember.key 
).parent.get('Component IDs') <> "(no component)"
THEN

Len([Issue.Sub-task].[Sub-task].Getmemberbykey(
[Issue].CurrentHierarchyMember.key 
).parent.get('Component IDs')) 
- 
Len(Replace([Issue.Sub-task].[Sub-task].Getmemberbykey(
[Issue].CurrentHierarchyMember.key 
).parent.get('Component IDs'), ',', ''))
+1
END

Martins / eazyBI

Thanks Martins for your quick revert.
Will try it out.
Will it be also possible to show the parent Component names aside from the parent component number?

([Issue.Sub-task].[Sub-task].Getmemberbykey(
[Issue].CurrentHierarchyMember.key
).parent.get(‘Component/s’))

Tried this seems working :slight_smile:

1 Like