Generate count of issues created per day and per hour

I am trying to generate two graphs/charts

1.I would like to see a count of the number of issues created per day
2. I would like to see a graph that shows me an hourly breakdown (for the month) of the time of day tickets are created. (I am trying to determine when is the busiest time of day)

I am not having any luck creating either one of these.

For #1 I tried to use issues created count in combination with the issue create date measure and I am unable to figure out how to do this.

Any suggestions

1 Like

Hi,

You can have the number of issues created per day by adding the Time dimension and expand all the members to the day level. The default measure Issues created is mapped to the time dimension by the issue creation date:

The solution for the hours’ breakdown would require the use of the advanced settings since the hour is not a standard dimension of the eazyBI data model.

You may try the following settings and import the Hour of Day Created field from the data import screen as a new dimension:

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

Kindly,
Janis, eazyBI support

Hi

I tried this solution, but regardless whether I try getHours() or getUTCHours(), the hour returned is 5 hours off.


Hi,
In the case of the eazyBI for Jira Cloud, you may need a different code with a hardcoded adjustment to the timezone offset:

javascript_code = '''
var tz_offset=-11;//hours from UTC
var c1=new Date(Date.parse(issue.fields.created));
c1.setHours(c1.getHours() + tz_offset);
var hours = c1.getHours();
issue.fields.customfield_hour_of_day_created = hours
'''

Kindly,
Janis, eazyBI support

Just passing by to Thank You for the answer! That’s exactly what i needed! :slight_smile:

2 Likes

I’m not sure what I’m missing here, but I can’t seem to get this in place.
Am I supposed to create a custom Jira field named Hour of Day Created?
How will that help me with past tickets?
I’m not entirely new to Jira, but am new to EazyBI and it just feels like I’m missing something with this suggestion.

Thanks for any guidance,
Devin

I figured out I need this in the Import portion of my Account Source Data, but I receive this error, “Execution of custom JavaScript code raised the following error:
unterminated string literal”

var tz_offset=-6;//hours from UTC
var c1=new Date(Date.parse(issue.fields.created));
c1.setHours(c1.getHours() + tz_offset);
var hours = c1.getHours();
issue.fields.customfield_hour_of_day_created = hours

Sorry I’m not a JavaScript guy, I ended up pasting the above only based on another Community post and it imported.