Multiple workflow triggers in a custom workflow



Multiple workflow triggers in a custom workflow

Overview

You can use one or more workflow triggers in a Comala Document Management workflow.

Using workflow triggers to create a custom email notification for different state changes

In our custom workflow, we have added three triggers.

 

Each trigger looks for a different change of state event.

Trigger One

On a change of state to QM - In Review

{"event": "on-change-state", "conditions": [ {"state": "QM - In Review"}

 

There are two "actions:"

  • an email is sent to the users who have been added as a value to the workflow parameter @QT@

  • an informative message dialog is shown

Trigger Two

On a change of state to QM - In Approval

{"event": "on-change-state", "conditions": [ {"state": "QM - In Approval"}

 

 There are two "actions:"

  • an email is sent to

    • the users who have been added as a value for the workflow parameter @QT@

    • the users who are members of the Confluence user groups added as a value for the workflow parameter @QM@

  • an informative message dialog is shown

Trigger Three

On a change of state to QM - Published

{"event": "on-change-state", "conditions": [ {"state": "QM - Published"}

 

There are two "actions:"

  • an email is sent to the user who created the page using the value reference @Creator@

  • an informative message dialog is shown

Here's the JSON codein full for these three workflow triggers.

"triggers": [ {"event": "on-change-state", "conditions": [ {"state": "QM - In Review"} ], "actions": [ {"action": "send-email", "recipients": [ "@QT@" ], "notification": {"subject": "${content.title} is QM - In Review State", "title": "${content.title} is QM - IN REVIEW State", "body": "Hello, ${content.link} in the ${content.space} space is in QM - In Review state and needs to be reviewed"}}, {"action": "set-message", "type": "info", "title": "This is the title of the dialog shown on your page", "body": "This is the body of the dialog shown on your page"} ]}, {"event": "on-change-state", "conditions": [ {"state": "QM - In Approval"} ], "actions": [ {"action": "send-email", "recipients": [ "@QT@", "@QM@" ], "notification": {"subject": "${content.title} is QM - In Approval State", "title": "${content.title} is QM - In Approval State", "body": "Hello, ${content.link} in the ${content.space} space QM - In Approval"}}, {"action": "set-message", "type": "info", "title": "This is the title of the dialog shown on your page", "body": "This is the body of the dialog shown on your page"} ]}, {"event": "on-change-state", "conditions": [ {"state": "QM - Published"} ], "actions": [ {"action": "send-email", "recipients": [ "@Creator@" ], "notification": {"subject": "${content.title} is QM - Published State", "title": "${content.title} is QM - Published State", "body":"Hello, ${content.link} in the ${content.space} space QM - Published"}}, {"action": "set-message", "type": "info", "title": "This is the title of the dialog shown on your page", "body": "This is the body of the dialog shown on your page"} ]} ]

In the code editor, multiple trigger events are enclosed in a single pair of "[" and "]" brackets prefaced by a single "triggers":.

You can add the workflow trigger to the workflow in the visual editor or the code editor.

Related Pages