Compare Start Date with Current date +1 day

Issue #522 resolved
Patrick Schuh [brainbits] created an issue

Hi Fidel,

again, its me... ;-) I'm struggling with the boolean...validator. I want to check if a given start date is set to now + 1 day. So, if the ticket is created today and the start date is also set for today then the validator should cast on.

Therefore I tried the following: {10503} > (datePart({00057}, LOCAL) + 1 * {DAY})

Comments (15)

  1. Fidel Castro Armario repo owner

    Hi Patrick,

    Assuming that field {10503} is a Date Picker maybe this should work:

    {10503} > datePart({00057}, LOCAL)
    

    In case it's a Date Time Picker, you should use:

    datePart({10503}, LOCAL) > datePart({00057}, LOCAL)
    
  2. Patrick Schuh [brainbits] reporter

    Unfortunately none of both works. I use a simple Date Picker, but the data is collected within Service Desk Portal. But that shouldn't make a difference, should it?

    To be precisely: the validator always casts on no matter what date I enter.

    23-02-_2017_19-18-37.png

  3. Fidel Castro Armario repo owner

    Do you want to validate that {10503} contains a date value corresponding to tomorrow or later?

  4. Fidel Castro Armario repo owner

    Try this one:

    datePart({10503}, USER_LOCAL) > datePart({00057}, USER_LOCAL)
    
  5. Patrick Schuh [brainbits] reporter

    Unfortunately still the same behavior. The validation blocks the transition no matter what date is entered.

  6. Fidel Castro Armario repo owner

    Are you sure that the transition blocking is not caused by the 2th validation in the transition?

    It's very strange. That's a very simple validation. I would like to see the problem in direct. Can we have a Skype video-conference with screen-share? I will be available today since 19:00 to 22:00 UTC, or on Monday from 9:00 UTC. Please, propose a time for the meeting.

  7. Fidel Castro Armario repo owner

    Can we have a Skype video-conference with screen-share? My user is fidel100r.

  8. Fidel Castro Armario repo owner

    I will be available since 9:00 UTC. Please, tell me, approximately, the time you will try to contact me,

  9. Patrick Schuh [brainbits] reporter

    Hi Fidel,

    sorry, I was not at the office yesterday. I will try to reach you now. :-)

  10. Patrick Schuh [brainbits] reporter

    Hi Fidel,

    I send you a contact request. I'm in the office for the whole day until 5 pm. Just give me a short hint when your are ready for a short call.

    Thank you Patrick

  11. Fidel Castro Armario repo owner

    Solved in the video-conference. The problem was due to a misconfiguration in the input format for the Date Pickers. Was solved restoring the default configuration at JIRA > System > General Configuration > Advanced.

    The final validation used was:

    datePart({10503}, USER_LOCAL) >= datePart({00057}, USER_LOCAL) + {DAY}
    
  12. Log in to comment