Set the due date based on the priority

Use case

Estimating a due date for every created issue can be time consuming. This whole process can be sped up by setting a due date based on some criterias, e.g. the associated epic.

In this use case the due date will be automatically set to a predefined value based on the selected priority.

🛠️ Configuration

Add a Update fields post function to the workflow transition you want. The Create issue transition might be the best choice here.

Target issue

Choose Current issue

Fields

Choose Due date

Value

In the popup, choose the value Set field value manually (parser expression)

Expression

Enter the following expression:

Bash
%{getMatchingValue(%{issue.priority}, 
["Highest", "High", "Medium", "Low"], 
[addDays({system.currentDateTime}, 3, RUN_AS_LOCAL),
addDays({system.currentDateTime}, 5, RUN_AS_LOCAL),
addDays({system.currentDateTime}, 10, RUN_AS_LOCAL),
addDays({system.currentDateTime}, 20, RUN_AS_LOCAL)])}

with parsing mode set to General.

Using this expression, the due date will be set to the following value:

  • If priority is Highest → Due date will be in 3 days from now

  • If priority is High → Due date will be in 5 days from now

  • If priority is Medium → Due date will be in 10 days from now

  • If priority is Low → Due date will be in 20 days from now

  • If priority is none of the above → Due date won't be updated

Use case Workflow function Parser functions
Set the due date based on the priority

Update fields

getMatchingValue()

Obtain the difference between two dates

Update fields


Assign an issue to the user who last commented on it

Update fields


Add three days skipping weekends automatically to a Date Picker

Update fields


Keep parent's priority in sync

Update fields


Set the assignee based on the issue type

Update fields

getMatchingValue()

Set the fix version to affects version when resolving an issue

Update fields


Use the app user to update non-editable fields

Update fields


Automatically add incident reporters to problem tickets

Update fields

append()

fieldValue()

linkedIssues()

toStringList()

Copy labels of a sub-task to the parent issue upon closing

Update fields


Assign an issue to the project lead, if the issue is unassigned on creation

Update fields


Add watchers from another field

Update fields

Transition issue

union()

toStringList()

Add a sub-task's summary and key to the description of its parent

Update fields


Set a date field to a future date

Update fields

dateTimeToString()

Record an auditable timestamp of a Compliance Approval

Update fields

dateTimeToString()

Copy field values from epic to issues under it after creation

Update fields Transition issue

epic()

issuesUnderEpic()

filterByStatus()

Set a date field to the current date

Update fields

dateTimeToString()

Assign important issues to the project lead

Update fields


Set the priority to Highest if the 'Infrastructure' component is selected

Update fields


Background priority calculation

Update fields

avg()