How Can I calculate Transition Count?

Hi, EazyBI Team.

I’d like to ask for help to make measure.
This is the measure I create.
I want to count number of ticket “Transition from Launch Verification status to Closed status AND Transition author has to be HQ_GMC”.
I try to make new measure which matches with two conditions, but it is not working well.
Could you check?

NonZero(
Count(
Filter(
Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
([Measures].[Transitions to status],
[Transition].[Launch Verification => Closed]) > 0
AND
([Measures].[Transitions to status],
[Transition Author].[HQ_GMC]) > 0
)
))

Hi, EazyBi team.
I resolved by using javascript cusom field.
But if there is any other way to make measue, please let me know.
Thanks.

[jira.customfield_autoclose]
name = “Auto Close”
data_type = “integer”
javascript_code = ‘’’
var autoclose = 0;
var status = issue.fields.status.name;
if (status.length > 0 && status == “Closed”) {
if (issue.changelog && issue.changelog.histories && issue.changelog.histories.length > 0) {
var histories = issue.changelog.histories;
for (var i = 0; i < histories.length; i++) {
var history = histories[i];
if(history.author.key == “online.ops”){
if (history.items && history.items.length > 0) {
for (var n = 0; n < history.items.length; n++) {
var item = history.items[n];
if (item.fromString == “Launch Verification” && item.toString == “Closed”) {
autoclose += 1;
break;
}
}
}
}
}
}
}
issue.fields.customfield_autoclose = autoclose;
‘’’

Hi @sujikim ,
You can try using tuple with those conditions and use measure Transitions to status issues count to get the issue count:
The formula would be like this:

([Measures].[Transitions to status issues count],
[Transition].[Launch Verification => Closed],
[Transition Author].[HQ_GMC])

best,
Gerda // support@eazyBI.com

1 Like

Thanks for your help!
It is really helpful :slight_smile:

I have a one more question.
If I want to add 1 condition more - status : closed
How can I modify formula?

Because after transition, sometimes it happens change to other status… so I want to check current status more.

Thanks.