Changing due date based on value set in custom field
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)
-
repo owner -
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.
-
reporter addDaysSkippingWeekends({11703.Weekly},7, LOCAL)
-
repo owner You can do it using "Set field as a function of other fields" post-function with the following configuration:
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.
-
reporter That's great!
What would I need to do to remove the weekend skipping?
-
repo owner Use the following setting rules instead:
(Weekly){00012} + {WEEK} (Monthly){00012} + {MONTH} (Quarterly){00012} + 4 * {MONTH} (Annually){00012} + {YEAR}
-
repo owner - changed status to resolved
-
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 ()
andsubtractDatesSkippingWeekends ()
functions, and much much more.I recommend you to take a look at it. You will be able to do amazing things using it.
- Log in to comment
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).