/
set-expiration trigger action



set-expiration trigger action

set-expiration trigger action

The Set Expiration trigger action is used to add or update the due date for a workflow state.

cdmc_visualeditor_workflowtrigger_action_setexpiration_withduedatedropdown_period_iso.png
Visual editor - Add Set Expiration action

The expiration is set for the workflow state specified in the workflow trigger condition. If no condition is set, the expiration is set for the workflow state when the event occurs.

Set Expiration action parameters

Action Parameter

Value

Notes

Action Parameter

Value

Notes

Due Date MANDATORY

Duration period or fixed date and time

  • Period: the duration period set for expiration as one of years, months, days, minutes, or seconds

  • ISO_8061: duration period set for expiration in formatted duration string, such as P1D

  • Fixed Date* as a specific date and time in user-preferred date format*

A value must be added for the Due Date.

The Set Expiration trigger action overrides any existing expiration for the state.

*In some cloud instances, a fixed due date must initially be added using the code editor. It is then displayed as an editable date value in the visual editor.

 

 

When the workflow trigger event occurs, the trigger checks that any required conditions are met, and if met, the "set-expiration" action sets a new expiration date. The due date can be a period of time or a specific date and time.

Adding a fixed due date

In some Cloud instances, you can only use the code editor to set the due date to a specific date and time.

cdmc_codeeditor_extract_triggeraction_setexpiration_fixeddate_value.png

Once added, you can switch to the visual editor to amend the fixed date.

cdmc_visualeditor_setexpirationtrigger_extract_editfixedate_calendar.png

When you change the Due Date to a duration period in the visual editor, the Fixed Date option is removed. You must then add a new Fixed Date value using the code editor.

“set-expiration” JSON code

A Set Expiration workflow trigger action added using the visual editor is automatically displayed in the workflow code editor as a “set-expiration” trigger action.

cdmc_visualeditor_setexpiration_trigger_action.png
Code editor - Workflow trigger with set-expiration action

You can also use the code editor to add the workflow trigger and the “set-expiration” action.

"set-expiration"

"set-expiration" sets an expiration due date for a state.

  • action (set-expiration)

    • dueDate❗️ Expiration due date

      • period (in ISO 8601 format)

      • fixed date (in the Confluence user-preferred format for the site)


❗️ Mandatory parameter

dueDate

A value must be added for the due date.


Example workflow trigger code

"triggers": [ {"event": "on-change-state", "conditions": [ {"final":true} ], "actions": [ {"action": "set-expiration", "dueDate": "P6M"} ]} ]

The "dueDate" in the above example is set using ISO 8601 format. For example, adding P6M3W5D adds a due date period that is 6 months, 3 weeks, and 5 days.


An existing state expiration can be removed using the Clear Expiration trigger action.

Related Pages