Issues created by hour intervals

Hello everyone!

I am currently trying to build a report of issues created per severity sorte by 3 different time intervals:

  • 6-14 UTC
  • 14-22 UTC
  • 22 - 6 UTC

Yet I see there is no “regular” way of achieving this, as we can only go down to “days” on the time hierarchy.

I would deeply appreciate if somebody could assist me with the process of creating a custom hour dimension.

Hello @Juan_PabloCJ,

You can create a custom “Hour of Day” dimension using JavaScript calculated custom fields. Here’s how:

Step 1: Create the Hour Dimension

Add this to your eazyBI advanced settings:

[jira.customfield_hour_of_day]
name = "Hour of Day Created"
data_type = "integer"
dimension = true
javascript_code = '''
var hours = new Date(Date.parse(issue.fields.created)).getUTCHours();
issue.fields.customfield_hour_of_day = hours;
'''

Step 2: Import the Dimension

Go to Source Data → Import options → Custom fields and select “Hour of Day Created” to import as a dimension.

Step 3: Create Calculated Measures for Your Time Intervals

Create these calculated members in the “Hour of Day Created” dimension:

For 6-14 UTC:

Aggregate(
  {[Hour of Day Created].[6],
   [Hour of Day Created].[7],
   [Hour of Day Created].[8],
   [Hour of Day Created].[9],
   [Hour of Day Created].[10],
   [Hour of Day Created].[11],
   [Hour of Day Created].[12],
   [Hour of Day Created].[13]}
)

For 14-22 UTC:

Aggregate(
  {[Hour of Day Created].[14],
   [Hour of Day Created].[15],
   [Hour of Day Created].[16],
   [Hour of Day Created].[17],
   [Hour of Day Created].[18],
   [Hour of Day Created].[19],
   [Hour of Day Created].[20],
   [Hour of Day Created].[21]}
)

For 22-6 UTC:

Aggregate(
  {[Hour of Day Created].[22],
   [Hour of Day Created].[23],
   [Hour of Day Created].[0],
   [Hour of Day Created].[1],
   [Hour of Day Created].[2],
   [Hour of Day Created].[3],
   [Hour of Day Created].[4],
   [Hour of Day Created].[5]}
)

Best,
Marita from support@eazybi.com

1 Like

Wow, thank you very much @Marita_Burgio !

I will give it a try later throughout the day.

1 Like