How to calculate total duration between issue created date and current date using Scripted Fields?
But the duration should be calculated only during the business/service hours i.e. only between 08:00 to 18:00 hours and it should exclude Weekends and other Holidays.
Also, We already have JWT plugin to calculate Status Durations (Time duration when the issue was in a particular issue).
So, is there any way we can use the JWT schedule in script runner groovy script and create a Script Field for this?
Hi @SWAPNIL SRIVASTAV ,
is there a particular reason you're asking for the combination of a JWT schedule and a scripted field?
Given JWT, you could simply configure your schedule (see the examples including holidays here: https://apps.decadis.net/display/JWT/Schedules+Definition+Grammar#SchedulesDefinitionGrammar-Examples) and use an expression like
timeDifference({00057},{00009}, "your_schedule_name", LOCAL)
with 00057 being the current date and time and 00009 being the date and time of issue creation.
Cheers
Thorsten
Hello @Thorsten Letschert _Decadis AG_ ,
I was not aware that we can create Custom Number Fields with JWT. Thank you. The Math/Time Expression worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thorsten Letschert _Decadis AG_ ,
The field is working properly and the duration is accurate but can I not use it in a JQL?
If I am using it in a JQL, sometimes JQL result is not proper.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.