"Validate a field" workflow validator using expression does not include option to include exact time in comparison

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Issue Summary

      The "Validate a field" workflow validator configured with a Date/Time field and the expression "Earlier than or same as now" has two problems:

      • The now expression only evaluates the date (e.g., April 28), not the full date and time (e.g., April 28, 15:30) when evaluated using the Expression tab
      • There is no option/checkbox to Include Time in the comparison when using Expression.

      Steps to Reproduce

      1. Add a custom field of type Date Time Picker (e.g., "Start Date/Time") to an issue type.
      1. Edit the workflow for that issue type and add a "Validate a field" validator on a transition.
      1. Configure the validator so that Start Date/Time must be "Earlier than or same as" the expression now.
      1. Publish the workflow.
      1. Open an issue using that workflow and set Start Date/Time to today with a future time (e.g., today at 23:30 when the current time is 15:00).
      1. Attempt the transition.

      Expected Results

      The expression comparison tab should include an option to "Include time" the same way the Field comparison currently does (see image)

      Actual Results

      There is a mismatch in the level of comparisons between fields and expressions for Date/Time field.

      Workaround

      In the workflow editor, within the "Validate a field" window:

      1. Click on the "Field" tab and check the "Include time" checkbox.
      1. Switch back to the "Expression" tab and verify the expression values are still correct.
      1. Important: You must switch back to the Expression tab before clicking Update. If you click Update while still on the Field tab, the expression values will be removed.
      1. Click Update, then Update workflow.

      This appears to fix both the time evaluation and the timezone issues.

              Assignee:
              Unassigned
              Reporter:
              Erick Ivan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: