Set Task Due Date Based on the Parent Workflow Item Due Date
You can set subtask parameters based on parameters of its parents. For example, you might need to set the due date of a subtask based on the parent task due date and the parent item priority.
Perform the following steps to set the task due date:
1. Open a workspace, open a necessary application inside a workspace.
2. Click «Workflow Scheme» and double click a required step.
3. In the window that appears, in the «Actions» group click «Task Assignment».
4. Select the «Assign tasks and pre-populate task fields» check box and expand «Task Settings».
5. Set the following rule for due date:
SUBTRACT($parent->dueDate, DURATION("P[n]Y[n]M[n]DT[n]H[n]M[n]S")) |
Use the $parent->$parent->Priority condition to return data from the item level to the subtask level.
IF($parent->$parent->Priority == ID("Priority.values.Low"), SUBSTRACT($parent->dueDate, DURATION("P3D12H")), IF($parent->$parent->Priority == ID("Priority.values.Medium"), SUBTRACT($parent->dueDate, DURATION("P1D12H")), SUBTRACT($parent->dueDate, DURATION("P12H")) )) |
The above expression sets the due date of a subtask depending on the priority of the parent item and the due date of the parent task. Type this expression as preset value for the due date of a subtask. You can also use the «SUBTRACT($parent->dueDate, DURATION(“P[n]Y[n]M[n]DT[n]H[n]M[n]S”))» function separately to set the due date of any child element depending on the parent element’s due date. Note that workflow items don't have the system field «Due Date», so you should pre-create it.