Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2
minLevel2
absoluteUrltrue
excludeRelated Pages
typeflat
separatorpipe

Overview

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

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

In our custom workflow, we have added three triggers.

Image Removed

Related pages
Image Added

JSON Triggers

Child pages (Children Display)
pageJSON Triggers

Add a JSON trigger using workflow builder

children
pageAdd a JSON trigger using workflow builder
first1

Each trigger looks for a different change of state event.

on

Trigger One

On a change of state to QM - In Review

Code Block
{"event": "on-change-state",
	"conditions":
	[
		{"state": "QM -
In Review 
 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@

, also
  • an informative message dialog is shown

Trigger Two

on

On a change of state to QM - In

Approval 

Approval

Code Block
{"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@

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

, also
  • an informative message dialog is shown

Trigger Three

on

On a change of state to QM -

Published 

Published

Code Block
{"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@

, also
  • an informative message dialog is shown

Here's the JSON notation in full for

the

these three workflow triggers.

Code Block
"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"}
	]}
]
(info)
Info

 Only one overall "triggers":

"

 notation will be required in the JSON code if added to a workflow using the JSON editor.

 In workflow builder you do not have to add the "triggers:" JSON element.

In the JSON markup

the three

multiple trigger events are enclosed in a single pair of "[" and "]

" brackets

" brackets prefaced by a single "triggers": JSON element.

You can add the JSON to the workflow in workflow builder.

Image Removed

 The following JSON code format for this example can easily be copied and pasted into workflow builder.

Expand
titleJSON format to add to workflow builder
Code Block
[{"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"}]}]
There is
Image Added

 There is no need to add the opening "

trigger

triggers"

JSON

: JSON when adding the JSON code to workflow builder. Workflow builder will automatically add this when you save the changes to the workflow.

Related Pages

User Guide

Reviewing Content

Add a JSON trigger using workflow

Using Workflow Builder

JSON triggers in the Content Expiry and Quality Management Systems workflows

builder

Child pages (Children Display)
pageAdd a JSON trigger using workflow builder visual editor
first1

Notifications