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.

1 Like

@DPMil

Where exactly did you use this Javascript in eazyBI?
Are you using it to define a new scripted field in advanced settings as this is the right and only place to paste this code when defining a new calculated field?
Once the field is defined in advanced settings you need to select and import it from the import options page.

Martins / eazyBI

Hey Martin,
I appreciate the response and opened a support ticket that helped point in the direction of our Jira allowlisting causing a potential problem. I’m receiving data now, but need to see if the report can be displayed the way we want.
We want it to show the number of tickets created per day per hour so we can track our busy times and shift our agent work times as necessary.
Any thoughts on that part?
-Devin

@DPMil

To split issues created by hours there is no other way than importing a new “Hour when created” dimension as explained above.

Martins / eazyBI

Hey @martins.vanags ,

We’ve tried to use this and it seems that it’s importing data and catching what we need. However an issue we have run into is twofold:

  • It seems like it’s missing some tickets created.
  • It’s offset by some hours

You will find the details in this screenshot. Jira values are the ones that we got from Jira export and EazyBi as the name suggests.

Any ideas?

Paldies :slight_smile:

Hi @Edgaras,

The offset by hours might mean that you have not applied the correct timezone offset in the Javascript code. Note that you might not see time in the Jira Server timezone once you filter issues in Jira if you have set the timezone in the user profile settings in Jira.

Please, check this link for more details: Issues with different update date

We need more details to check the reasons for missing issues. Please, apply to the support by providing the eazyBI Javascript custom field settings, report definition, and the filter by which you counted the issues in Jira.

Kindly,
Janis, eazyBI support