Example: Set "Due date" with certain time offset from current date
I would like to update the Due date with Current date+2 while creating an issue. I have added the following post function through Jira Workflow Toolbox,
- Option selected: Copy a parsed text to a field
- Target Field : due date
- Text to be parsed and then copied to target field:
{Current date and time}+2*{DAY}
But it is not updating anything on the Due Date field. Please advise on the syntax to be used.
To do mathematical or time calculations like the one you are trying to do, you should use post-function Mathematical and date-time expression calculator.
If you use the formula {00057}+2*{DAY}
, you will be adding to natural days to current date and time. Next version of the plugin (2.0.19) will provide function addDaysSkippingWeekends(t, n, time_zone). With this function you will be able to add "working days", i.e., you will be able to add days skipping the weekends.
Text to be parsed is: addDaysSkippingWeekends({00057},2,LOCAL)
Note that %{00057} is field code for "Current date and time".
Once configured, the transition looks like this:
Other examples of that function
- Automatic work log with start and stop work transitions
- Automatically log work time when the user uses a "Stop Progress" transition
- Calculate the time elapsed between 2 transition executions
- Getting the number of selected values in a custom field of type Multi Select
- Implement a form with a series of questions and calculate a numeric value based on the answers
- Increment a field or set to 1 if it's not set
- Set "Date-Time Picker" custom field with current date-time
- Set "Due date" 6 natural days (or work days) earlier than a "Date Picker" custom field
- Set "Due date" to a specific day of next week no matter of date of creation this week
- Set "Due date" with certain time offset from current date
- Set "Total time spent" to "Current date and time - date and time of last update"
- Set a custom field "Urgency" depending on a combined value of issue's priority and "Impact" custom field
- Sum "Time Spent" in all sub-tasks of issues linked with issue link types "LinkA", "LinkB", "LinkC"
- Triage Jira Service Desk email requests (Move issues)
- Using project properties to calculate custom sequence numbers