Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,898
Community Members
 
Community Events
184
Community Groups

Calculate how much business time it happens between 2 dates (weeks, days, hours, minutes)

Edited

Hi,

I'd like to know if you can help me with this: I'm trying to calculate how much business time it happens between 2 dates (weeks, days, hours, minutes), for example:

  • Date A: 2022-08-18 10:00 AM
  • Date B: 2022-08-26 02:30 PM

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

I need to calculate the business time between Date A and Date B: 1w 1d 4h 30m

 

Thanks in advance!!

1 answer

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 01, 2022 • edited

Hi @Nicolás Donnelly Kehoe and welcome to the community!

This can be done with automation, but I'd need further context into how you're planning to use this data.  For example, if you're looking to capture it in a report/dashboard, you'd need to capture the data in a custom field vs sending a communication (comment, slack/teams, email), it could just be in the body of the message. 

Here's a quick example of how it could work (I'm using Now and Due Date):

  • TRIGGER: Field Value Changed (Due Date)
  • ACTION: Add Comment
    • {{now.diff(issue.dueDate).businessDays}}
    • To get hours, mins, seconds, you'd need to do some math against that... Weeks = {{#=}}now.diff(issue.dueDate).businessDays}}/5{{/}}
      Hours = {{#=}}now.diff(issue.dueDate).businessDays}}*8{{/}}

Hi @Mark Segall 

Thanks for you response!

I've tried using that function but I think it returns just the number of days between those dates. I believe it doesn't include number of hours, minutes. 

For more context, I'm trying to create an automation to log work when an issue goes from WIP to DONE. 

Thanks again

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 01, 2022

Sorry - Edited my response after.  You'll need to perform some math functions to get the breakdown you're looking for, but it all starts with Date Diff and businessDays

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 01, 2022

Unless someone beats me to it, I'll spend a little time on this later today to try and help with exact math functions.

Thanks a lot Mark! I really appreciate your support!

I'll also try to apply what you have shared with me before.

Honestly, I added an automation handler and call an webhook with the issue payload. My webhook endpoint calculates the hours, and updates the field. Or, returns that value back.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events