Please help me for date calculation

Issue #359 resolved
Elvir DLN created an issue

Hello

I am trying to calculate a date based on another numeric field:

Date = duedate - (number of words/ 1500} days (skipping the weekends)

How could I achieve this ?

Thank you for your help

Comments (13)

  1. Fidel Castro Armario repo owner

    I have some questions:

    • Is "Number of words" a numeric custom field?
    • What you intend to do is to move earlier in time "Due date" based on "Number of words" custom field? Being more specific, to move 1 day back in time, per each 1,500 words. Please, confirm.
    • What happens when the number of words is nor divisible by 1500, e.g., when we have a value like 2,500, or 1,600, should we move "Due date" 2 day earlier, or not? Yes, with 2,500, and No with 1,600?
  2. Elvir DLN reporter

    Hello

    • Yes number of words is a numeric field. A translator can translate 1500 words per day. Yes we have to move back 1 day per each 1500 without counting the weekends
    • so 2,500 / 1,500 = 1.66. we should move back 2 days 1600/ 1500 = 1.06. we should move back 1 day

    Please let me know if you need more information

  3. Fidel Castro Armario repo owner

    Hi @edzeladin,

    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.

  4. Elvir DLN reporter

    Hi Fidel

    Thanks for the feedback. I already used subtractDatesSkippingWeekends () to calculate the time between create date and start date. I was wondering if we could add some parameters.

    My company is not working between 22 of december and 2nd of january every year. How could we skip this period in the calculation.

    Thanks.

    Elvir

  5. Fidel Castro Armario repo owner

    Hi @edzeladin,

    Can you, please, attach a screenshot of the configuration you are currently using to do the calculation?

  6. Fidel Castro Armario repo owner

    Use the following formula:

    floor(timeDifference({11204}, {00009}, "my_schedule", LOCAL) / {DAY})
    

    where my_schedule uses the following SDG definition:

    #Mondays to Fridays we count the whole day
    MON - FRI {
       00:00 - 00:00;   # whole day interval
    }
    
    #Christmas holidays
    DEC/22 - JAN/2 {;}
    

    Schedules are defined in JIRA at Administration > Add-ons > JIRA WORKFLOW TOOLBOX > Schedules.

  7. Fidel Castro Armario repo owner

    Hi @Elvir,

    Thanks for your words. It's a very new feature, and I think it will be very valuable to most users, but it's still unknown. Please, consider sharing your experience with a little review at the marketplace listing. Thanks.

  8. Log in to comment