$formatedValue and errors in logs when using Calculated dat-time field
Hi Fidel,
I found bug when I implemented "Calculated date time" fields [see prtscn] In that field I'm using following expression:
first(timesOfTransition("","Development completed"))
The error is shown when such transition never happened. In logs can be seen nullpointerexception
2017-04-07 15:44:21,031 http-nio-8443-exec-14 WARN hkut 944x617123x1 5mx9pd 10.41.146.29,10.41.146.28 /browse/GBLIOS-2516 [c.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'java.lang.NullPointerException - null'.
2017-04-07 15:44:21,087 http-nio-8443-exec-14 WARN hkut 944x617123x1 5mx9pd 10.41.146.29,10.41.146.28 /browse/GBLIOS-2516 [c.f.j.p.workflowToolbox.parser.ParserValueProvider] *** String "" can't be cast to number.
2017-04-07 15:46:43,769 http-nio-8443-exec-12 WARN hkut 946x617389x1 5mx9pd 10.41.146.29,10.41.146.28 /issues/ [c.f.j.p.workflowToolbox.parser.ParserValueProvider] *** String "" can't be cast to number.
2
Our Jira version is 7.1.6 and I've just installed newest version of your plugin.
Comments (10)
-
repo owner -
repo owner Hi Hubert,
I'm not reproducing the problem using version 2.2.35. In my case it works correctly, and I don't get any error message in the log file.
Can you please confirm the version of the JIRA Workflow Toolbox you are using?
-
reporter Hey Fidel,
I confirm that our JWT version is 2.2.35. We still experience same problem. Please follow these steps to reproduce it at your side. The error exists in issue filter when I add field "Days between dev and qa"[calculated text field] as a column (see prtscn). The formula for this field is:
shortFormatDuration(subtractDatesSkippingWeekends({In QA Testing Date and Time},{Development completed 2},USER_LOCAL))
These fields are "Calculated Date-Time Field" Formula for "{In QA Testing Date and Time}"
last(timesOfTransition("","In QA Testing"))
Formula for "{Development completed 2}"
first(timesOfTransition("","Development completed"))
-
reporter - attached Screenshot at Apr 18 10-50-32.png
- attached Screen Shot 2017-04-18 at 10.36.53.png
Errors
-
reporter - attached error log.pdf
-
repo owner Hi Hubert,
Please, try the following text expression for field "Days between dev and qa":
{aaaaa} != null AND {bbbbb} != null ? shortFormatDuration(subtractDatesSkippingWeekends({aaaaa}, {bbbbb}, USER_LOCAL)) : ""
where aaaaa is field code for "In QA Testing Date and Time", and bbbbb is field code for "Development completed 2".
It's even better to use "Calculated Number Field" with the following configuration:
Formula:
{aaaaa} != null AND {bbbbb} != null ? subtractDatesSkippingWeekends({aaaaa}, {bbbbb}, USER_LOCAL) : null
Display format is:
-
repo owner The bug has been fixed in version 2.2.36_beta_2. Can you, please, confirm that this version solves your problem with your current configuration?
Anyway, I recommend you to use "Calculated Number Field" instead of "Calculated Text Field".
-
reporter Hi Fidel,
I've checked and both solutions which you provided work for us (changing formula and installing beta version). Thanks for your support!
P.S we can't use calculated number field because our users want to have prefix and sufix in the field ;)
Cheers! Hubert
-
repo owner - changed status to resolved
Fixed in just released version 2.2.36.
-
repo owner Hi @hkut,
Since version 2.2.39, JIRA Workflow Toolbox supports Custom Schedules, and you can do all you are doing now using
addTimeSkippingWeekends ()
andsubtractDatesSkippingWeekends ()
functions, and much much more.I recommend you to take a look at it. You will be able to do amazing things using it.
- Log in to comment
Hi Hubert,
Thank you for reporting the bug. It will be fixed in next version of the plugin.