Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Find Business hours since issue creation using jira automation

Vishal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2024

Hi There,

I need to find out business hours since issue creation, i know there is smart value available to get the business days {{issue.created.diff(now).businessdays}}, but I need the exact business hours since issue creation.

Does anyone know how to get it ?

Thank you.

5 answers

2 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2024

Hi @Vishal 

There is nothing built in to do this with automation rules, but it is possible using assumptions, and math and date / time functions.

For your scenario, you want the working flow time between two date / time values.  The assumptions to support that might be:

  • the work day is 8 am to 5 pm, inclusive
  • the working days are Monday - Friday, inclusive
  • issues created outside of working hours effectively start at 8 am on the next business day
  • if {{now}} is outside of working hours, it effectively ends at 5 pm on the prior business day
  • the calculation will ignore all holidays during the working days
  • the calculation will ignore any lunch / break hours during the day

Using those assumptions, you could perform the math by:

  1. identify the effective start date / time
  2. identify the effective end date / time
  3. if both #1 and #2 are on the same calendar day, perform the difference as you are DONE.  Otherwise...
  4. calculate any working hours from start of #1 until the end of day (5 pm) for that date
  5. calculate any working hours from start of day (8 am) until #2 for that date
  6. calculate the number of business days difference from [#1 incremented to the next business day] and [#2 decremented to the previous business day] and multiply that by the number of working hours per day
  7. the solution is #4 + #5 + #6

Then write down all the test cases, test thoroughly!

 

If you look at this post I made, it describes a related scenario to pretty print a duration of time as business timehttps://community.atlassian.com/t5/Automation-discussions/What-is-your-most-useful-automation-Here-is-mine/td-p/1560668#M523

 

Kind regards,
Bill

1 vote
Valeriia_Havrylenko_SaaSJet
Atlassian Partner
February 23, 2024

Hello @Vishal 👋

What you are trying to measure is often called "Time In Status" and can sum up to "Build Cycle Time" when it spans the different status values from start-of-work until completion.

There is nothing built-in which can do that for working hours. Instead the built-in, i recommend you to try you Time in Status for Jira by SaaSJet.

image.png
You can also book a live demo - we'll show you the application inside out and answer all your questions.

Add-on has a 30-day free trial version and  free up to 10 users.
Hope it helps 😌

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
February 26, 2024

Hi @Vishal

You can use lead time (the time interval between the moment an issue is requested to the moment it is completed) reports to get the time since issue creation.

If you prefer to use a marketplace app, you can try Status Time Reports app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status and status durations are calculated according to the working calendar you define.

Here is the online demo link, you can see it in action and try without installing the app. For your case, you can have a look at Lead Time for Each Issue report.

For further details, you can have a look at Cycle Time and Lead Time in Jira: Productivity Measurement with Two Critical Parameters article and Status Time Reports How to Videos.

  • This app has a dynamic status grouping feature so that you can generate various valuable reports as time in status, time in assignee, status entry dates and status counts, cycle time and lead time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month).
  • You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
  • Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.
  • You can set different duration formats.
  • You can export reports in CSV file format and open them in MS Excel.
  • You can also add this app as a gadget to your Jira dashboards and reach “Status Time” from Issue Detail page.
  • You can enable/disable access to Status Time reports&gadgets and Issue Detail page per project, users, groups or project role.

If you are looking for a completely free solution, you can try the limited version Status Time Reports Free.

Hope it helps.

0 votes
Gizem Gökçe _OBSS_
Atlassian Partner
February 23, 2024

Hello @Vishal

Have you considered using a third-party application for this type of reporting? It could provide more accurate and comprehensive results.

.I believe Timepiece - Time in Status for Jira which is developed by my team at OBSS, has a report type that will meet your need.  Our app is available for both Jira Cloud, and Data Center. 

Time in Status mainly allows you to see how much time each issue spent on each status or each assignee. With the reports available in it, you can calculate how many hours spent since the issue creation.

The application also offers custom calendar support. Calendars can be configured based on your business hours, excluding holidays and non-working hours (even lunch breaks) from the calculation. Time in Status reports can be generated based on your custom calendars. Please see the screenshots below that I prepared for you, for custom calendar support and the business hours calculation of issues since creation. 

Cstom Calendar.png

Issue Creation in days.png

The app calculates its reports using already existing Jira issue histories so when you install the app, you don't need to add anything to your issue workflows and you can get reports on your past issues as well.

Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts. And the app has a REST API so you can get the reports from Jira UI or via REST. Also you can export the reports in to various formats easily. 

Visit Timepiece - Time in Status for Jira to explore how our JIRA add-on can revolutionize your reporting process. Enjoy a 30-day free trial to experience the full range of features.

Hope it helps,

Gizem

0 votes
Sebastian Krzewiński
Community Champion
February 22, 2024

Hi @Vishal 

 

Based on https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-plus-unit--- :

BusinessDays (business days are considered to be Monday to Friday, 9am to 6pm)

 

hope that helps!

 

Regards,

Seba

 

Vishal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2024

Hi @Sebastian Krzewiński 

It gives in days but I need in hours & not days.

Thanks

Sebastian Krzewiński
Community Champion
February 22, 2024

sorry fro misunderstanding. I don't think that it is possible. 

What cam to my mind is to try to use date format somehow in your formula.

Suggest an answer

Log in or Sign up to answer