Exclude Sundays from Validation

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

Hi Fidel,

im struggeling with the following issue: I have a selectfield that holds a priority represented by a "2" or a "3". Depending on that I would like to add a validation rule in the create transition that checks for the earliest possible start date. With Prio 2 its 5 days from now excluding sundays, with Prio 3 its 15 days excluding sundays.

I found your adddaysskippingweekend function but could not get it working.

Givven that 10119 is the Priority Select field and 00057 the startdate I tried the following:

( %{11303} = "2" AND {10119} >= {00057} + addDaysSkippingWeekends({00057}, 5, LOCAL, {SUNDAY}, {SUNDAY})) OR ( %{11303} = "3" AND {10119} >= {00057} + addDaysSkippingWeekends({00057}, 15, LOCAL, {SUNDAY}, {SUNDAY}) )

However, the following works fine:

(%{11303} = 2 AND {10119} >= {00057} + 5 * {DAY}) OR (%{11303} = 3 AND {10119} >= {00057} + 15 * {DAY}) 

Comments (3)

  1. Fidel Castro Armario repo owner

    Hi @pschuh,

    Try the following boolean expression:

    (%{11303} = "2" IMPLIES {10119} >= addDaysSkippingWeekends({00057}, 5, LOCAL, {SUNDAY}, {SUNDAY})) AND 
    (%{11303} = "3" IMPLIES {10119} >= addDaysSkippingWeekends({00057}, 15, LOCAL, {SUNDAY}, {SUNDAY}))
    

    where %{11303} is Priority, and {10119} is code for numeric value of Start date.

  2. Fidel Castro Armario repo owner

    Hi @pschuh,

    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.

  3. Log in to comment