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,296,598
Community Members
 
Community Events
165
Community Groups

Calculate difference from two date time picker

Dear Community,

I am a newbie and searching a solution to calculate the total time in hours and min from two date time pickers. One represents Start the other the End.

StartDate = 10.10.2020 4PM

EndDate = 11.10.2020 3:30PM

Result = 23:30

Goal is to automatically calculate the time difference and store it an another field.

In case on of you have an answer or even the same problem I would appreciate any information which could help me. I used the search function already but couldn´t figure out there to set scripts etc.

Best,

Kristian

2 answers

Hi @Kristian Koniarz ,

You may try the Table Filter and Charts for Confluence app and its Table Transformer macro.

Wrap your table in the Table Transformer macro and add the following custom SQL query:

SELECT T1.'Start Date',
T1.'End Date',
DATEDIFF(hour, T1.'Start Date', T1.'End Date') as 'Result'
FROM T1

Fri 2-1.pngFri 2-2.pngThen you need to set an appropriate Date format for the case:

Fri 2-3.pngNow you can preview the result:

Fri 2-4.pngHope this will help your case.

Thanks for your time and suggestion @Katerina Kovriga _Stiltsoft_,

Unfortunately I am not authorised to purchase new plugins. Still checking the web through inbuild script solutions.

Best,

Kristian

1 vote
Daniel Ebers Community Leader Nov 13, 2020

Hi Kristian,

I came across such requirement for calculation of a duration. We used "Jira Workflow Toolbox" with a formula like this:

%{Resolution} != null ? shortFormatDuration({End Date} - {Start Date}) : (%{Resolution} = null ? shortFormatDuration({Current date and time} - {Start Date}) : %{Resolution})

The last part is only to calculate against the current time in case the resolution is not yet set (meaning: the issue is still 'running'). You might need to adjust it according to your needs even in case you would go with Jira Workflow Toolbox.

Cheers,
Daniel

Thanks for your time and suggestion @Daniel Ebers 

Unfortunately I am not authorised to purchase new plugins. Would it be possible to implement a logic as you described with the help of an script? Which can be set inline during the workflow.

Best,

Kristian

Which plugins do you have on your instance? Without any plugin (app), Jira doesn't offer any scripting.

Hello @David Fischer _Appfire_

so far I got MyGroovy and thought it could be realised with this software.

In case it wouldn´t cover my needs I need to drop my question.

Best,

Kristian

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

369 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you