How to substract 6 days to a date

Issue #72 resolved
Christine Rolland created an issue

Hello,

I tried to use the substractDays... function and it does not. The due date stays empty.

I tries 6 * {DAY}, I am not sure if it is the good way...

Actually, on the creation, I want to push the value "Ship date - 6 days" to Due date.

Thanks

Comments (11)

  1. Fidel Castro Armario repo owner

    Hi Christine,

    In case you want to subtract 6 natural days to Due Date, you have to use post-function "Mathematical or date-time expression calculator" with the following configuration:

    conf-1.png

    Notice that:

    • {12200} is the code for numeric value of field Ship Date. This code depends on each JIRA instance.

    Once configured, transition "Create Issue" will look like this:

    conf-2.png

  2. Fidel Castro Armario repo owner

    Hi Christine,

    In case you want to subtract 6 work days to Due Date, you have to use post-function "Mathematical or date-time expression calculator" with the following configuration:

    conf-1.png

    Notice that:

    • {12200} is the code for numeric value of field Ship Date. This code depends on each JIRA instance.
    • Work days depend on timezone, since certain moment in time may be Sunday in some timezones, and Monday in other ones. In the example we are using JIRA server's local time, but we can use any other timezone. If you want to use the current user's time zone you should use USER_LOCAL instead.

    Once configured, transition "Create Issue" will look like this:

    conf-2.png

  3. Christine Rolland reporter

    I tried with no success...

    Ship date = 7/Oct/14 and due date became 19/Dec/01.

    Here is my post-function : subtractDatesSkippingWeekends({16411}, 6 * {DAY}, SERVER_LOCAL)

  4. Fidel Castro Armario repo owner

    Hi Christine,

    I made a mistake in the function to be used. You should use function addDaysSkippingWeekends instead of subtractDatesSkippingWeekends.

    I have edited and fixed my description of the solution in a previous comment.

    Please, close the issue if the solution works for you.

    Thanks.

  5. Fidel Castro Armario repo owner

    Hi @crolland7,

    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.

  6. Log in to comment