-
assigned issue to
- marked as task
- marked as trivial
- edited description
Post function to increase Date Picker field in one day.
Hello @fcarmario
I hope you are well and you are enjoying the summer.
I have a quick question: I have a Date Picker (date only) type of field in one of the create screen in a specific project. Now I have another field called "Late Shift After 18:00" (Checkbox type of field) with only one option "Yes" (not required) under the in the Date Picker field. I would like to have a post function which will increase the date in one day on condition that the tick box "Yes" us marked ,i.e. the value is not Empty.
For example if on the create screen you have selected the date 28/02/2016 and you have ticked the box "Yes" than in the created ticket the date should be 01/03/2016
Is this feasible?
Official response
Comments (8)
-
Account Deactivated reporter -
repo owner Hi Shai, Thanks. I hope you are well too.
You should use "Mathematical and date-time expression calculator" post-function with the following configuration:
- Target field: select the Date Picker you want to increase.
- Formula:
{nnnnn} + {DAY}
- Conditional execution:
{aaaaa} = "Yes"
replacing nnnnn with field code for Date Picker field, and aaaaa with field code for Checkbox custom field.
In case you want to increase Date Picker field in 1 day skipping weekends, use the following formula:
addDaysSkippingWeekends({nnnnn}, 1, LOCAL)
-
Account Deactivated reporter How can I achieve this through the create screen as there is no condition on "Create" transition (only validator) Should I create another transition?
-
repo owner Sorry, I made a mistake in my previous post. You should use "Mathematical and date-time expression calculator" post-function in "Create Issue" transition. Insert your post-function after "Creates the issue originally" post-function.
-
Account Deactivated reporter Great suff @fcarmario
All works like a charm and you can close this request.
-
repo owner - changed status to resolved
-
repo owner Hi @shai_dahan,
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.
-
Account Deactivated reporter Hello @fcarmario
Thank you very much for the heads up.
I will try this feature as soon as I can
- Log in to comment
Hi Shai, Thanks. I hope you are well too.
You should use "Mathematical and date-time expression calculator" post-function with the following configuration:
replacing nnnnn with field code for Date Picker field, and aaaaa with field code for Checkbox custom field.
In case you want to increase Date Picker field in 1 day skipping weekends, use the following formula: