Set Task Due Date Based on the Parent Workflow Item Priority
You might need to define the task due date based on the parent item priority. Workflow items don't have a default system field for priority. Create a new field of the List of Values type intended for setting the priority of an item. For example, create the «Priority» (ID: Priority) field and drag it to the form of a workflow item. Populate the list with the following values:
Value | ID (created automatically) |
---|---|
Low | Priority.values.Low |
Medium | Priority.values.Medium |
High | Priority.values.High |
Perform the following steps to specify the due date of a task:
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:
IF($parent->Priority == ID("Priority.values.Low"), ADD($$now, DURATION("P7D")), IF($parent->Priority == ID("Priority.values.Medium"), ADD($$now, DURATION("P3D")), ADD($$now, DURATION("P1D")) )) |
With this expression, the higher priority is selected, the less task duration is specified. To check how it works, create a new workflow item, select its priority and move it through workflow. On the required step the child task will be created with the due date set according to the predefined rule.