date parsers

Issue #60 resolved
Matthew Rotenbury created an issue

NOTE: I'm running version 2.1.20_beta_4 in my test environment.

It appears the date parsers are not functioning correctly. I've tried both the dayOfTheWeek as well as hour parsers, and I am consistently getting the following error:

:: PARSE ERROR : Encountered "" at line 1, column 1. Was expecting one of:

An example of my configuration that's producing this error is: (hour(%{10470}) < 4) or (dayOfTheWeek(%{10470}) < {Wednesday})

Field 10470 is a date-type field. I've also tried it with the current date field which is a "date and time" type field with equal results. I've tried both with and without the time zone variable and for dayOfTheWeek I've tried with both the macro "{Wednesday}" as well as the numeric 4. Neither worked.

If it's an incorrect configuration on my end, please advise. Likewise, if you need some additional information, let me know.

Thanks, -Matt

Comments (3)

  1. Fidel Castro Armario repo owner

    Correct boolean expression is:

    Captura de pantalla 2014-08-01 a la(s) 16.51.14.png

    For readability I copy and paste here the expression entered:

    hour({10470}, LOCAL) < 4 OR dayOfTheWeek({10470}, LOCAL) < {WEDNESDAY}

    The syntax errors in your expression are:

    • You are using field code %{10470} which is a string value, while in this case we have to use field code for numeric value, i.e., {10470}.
    • Time macros must be written in upper case, i.e., you should write {WEDNESDAY}
    • Functions hour(t, timezone) and dayOfTheWeek(t, timezone) expect two arguments, and in your expression the second one (timezone) is missing.

    On the other hand, I inform you that it's also possible to compare and validate the date part of a date-time value. For example, you can use the following expression to check if date-time in field {10470} contains a value with time part between 08:30 and 19:00 in JIRA server's timezone:

    timePart({10470}, LOCAL) >= 08:30 AND timePart({10470}, LOCAL) <= 19:00

    Don't hesitate to ask for support if you need help to write a time expression.

  2. Matthew Rotenbury reporter

    Excellent, that did it... That additional little '%' getting in the way.

    Thanks!

  3. Log in to comment