$formatedValue and errors in logs when using Calculated dat-time field

Issue #573 resolved
Hubert Kut (MWK) created an issue

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)

  1. Fidel Castro Armario repo owner

    Hi Hubert,

    Thank you for reporting the bug. It will be fixed in next version of the plugin.

  2. Fidel Castro Armario 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?

  3. Hubert Kut (MWK) 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"))
    
  4. Fidel Castro Armario 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: Captura de pantalla 2017-04-18 a las 16.09.48.png

  5. Hubert Kut (MWK) 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

  6. Fidel Castro Armario 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 () and subtractDatesSkippingWeekends () functions, and much much more.

    I recommend you to take a look at it. You will be able to do amazing things using it.

  7. Log in to comment