Changing due date based on value set in custom field

Issue #265 resolved
alexlwilson created an issue

How can I set up a mathematical post-function to read a field called "Frequency" and have it adjust the due date by one month, or by whatever frequency is set in the custom field?

Comments (8)

  1. Fidel Castro Armario repo owner

    Hi Alex,

    I assume that "Frequency" contains a numeric value. Please, tell me which time unit is used for it value (minutes, hours, days, weeks, or whatever).

  2. alexlwilson reporter

    Currently the options for the frequency field are weekly, monthly, quarterly, annually. They are not represented numerically in that field.

    I figured the script would read the value set in the field and translate it from Monthly to the numeric value of 30.

  3. Fidel Castro Armario repo owner

    You can do it using "Set field as a function of other fields" post-function with the following configuration:

    Captura de pantalla 2016-03-10 a las 20.31.33.png

    Setting rules are:

    (Weekly)addTimeSkippingWeekends({00012}, {WEEK}, LOCAL)
    (Monthly)addTimeSkippingWeekends({00012}, {MONTH}, LOCAL)
    (Quarterly)addTimeSkippingWeekends({00012}, 4 * {MONTH}, LOCAL)
    (Annually)addTimeSkippingWeekends({00012}, {YEAR}, LOCAL)
    

    Note that {00012} is field code for Due date.

  4. Fidel Castro Armario repo owner

    Use the following setting rules instead:

    (Weekly){00012} + {WEEK}
    (Monthly){00012} + {MONTH}
    (Quarterly){00012} + 4 * {MONTH}
    (Annually){00012} + {YEAR}
    
  5. Fidel Castro Armario repo owner

    Hi @alexlwilson,

    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