---
title: "Calculate the due date based on custom field values"
canonical: "https://support.appfire.com/space/PSJ/15482513/Calculate%20the%20due%20date%20based%20on%20custom%20field%20values"
format: markdown
---
> Macro (aura-html)

 

Call the following script from a workflow transition post function. The script sets the due date based on the value of custom field `10703`.

```
if(isNotNull(customfield_10703)) {
    interval i = (string)customfield_10703 + "d";
    dueDate = currentDate() + i;
};
```