Overview


One or more trigger actions can be set for a named event in the workflow. When the workflow event occurs the trigger will check that any required condition is met, and if met the action(s) will occur.

Actions

A list of actions to perform once the event has occurred and the conditions are fulfilled.

A single trigger may include one or more actions.


Triggers can be added to a workflow using workflow builder.


"triggers:"
[
	{"event": "on-change-state",
		"conditions":
		[
			{"state": "Rejected"} ],
		"actions":
		[
			{"action":"set-message", "type":"info", "title":"Hey My Wonderful design and Tech Team", "body":"We have some work to do ... it was rejected!!!"}
		]
	}
]

(info)  If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

If the action includes a "user" parameter, the users can only be added using the userId. The "group" parameter value can be added as either groupId or groupName. Both the "user" and the "group" parameters accept workflow parameters.


"change-state"

The trigger action "change-state" causes a change of the state to the specified state if the provided parameters are valid.

  • action (change-state)
  • state (string) ❗️ State to move into

❗️ indicates a mandatory parameter - the state parameter and the destination state must be added for the trigger action

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "change-state",
			"state": "Review"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

The destination state must be specified.

"publish-page"

Publishes a single page to a different space using Comala Publishing for Cloud app.

  • action (publish-page)

The trigger action is only available when the Comala Publishing for Cloud app is installed and the current space has been enabled as a draft space for publishing to target public space.

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "publish-page"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

The target space for publishing the page is configured in the Comala Publishing space settings.

"approve"

The trigger action "approve"causes an approved decision to occur for a named approval if the provided parameters are valid.

  • action (approve
  • approval (string) Name of the Approval to be approved. If not specified, default approval will be used
  • user (string) a single Atlassian userID of the approver

❗️ no mandatory parameter - only the approve action is required. If no named approval, the action uses the default approval in the workflow. 

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "approve",
			"approval": "Sign-off",
			"user":"5d52a37ef0f22a0da2d6f070"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

The Atlassian user Identification Number (userId) is visible in the URL when viewing the User Profile

"reject"

The trigger action "reject" causes a rejected decision to occur for a named approval if the provided parameters are valid.

  • action (reject
  • approval (string) Name of the approval to be rejected. If not specified, default approval will be used
  • user (string)  a single Atlassian userID of the approver

❗️ no mandatory parameter - only the "reject" action is required. If no named approval is not specified, the action uses the default approval in the workflow.

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "reject",
			"approval": "Sign-off",
			"user":"5d52a37ef0f22a0da2d6f070"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

The Atlassian user Identification Number (userId) is visible in the URL when viewing the User Profile

"assign" and "unassign"

The trigger action "assign" will assign a user to a named approval.

  • action (assign
  • approval (string) Name of the Approval to assign. If not specified, default approval will be used
  • comment (string) Comment for the assignation operation
  • assigner (string) Atlassian  userID from the assigner
  • user (string) ❗️ Atlassian userID for the assignee
  • group (string) Atlassian groupID or groupName for assignees

❗️ indicates a mandatory parameter -  the assignee "user" parameter value must be specified with at least one user or instead specify at least one group 

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "assign",
			"approval": "Triagereview",
			"user": "5d52a37ef0f22a0da2d6f070",
			"group": "qa_reviewers"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

To assign members of a Confluence group as reviewers instead of a single user include "group":"qa_reviewers". The "group" parameter can use both the groupID and the Confluence groupName.

At least one assignee must be specified - either a user or a group or one of each.

The Atlassian user Identification Number (userId) is visible in the URL when viewing the User Profile

The trigger action "unassign" can be used to remove a specified user  from a named approval.

(info) You can only assign one user and/or one group in a single "assign" action. You cannot add multiple values for  "user" or "group".

"set-expiration"

"set-expiration" will set an expiry period for a state.

  • action (set-expiration)
  • dueDate (string) ❗️ Due date in format ISO 8601

❗️ indicates a mandatory parameter -  a "dueDate" parameter value must be specified

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

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

The "dueDate" period is set using ISO 8601 format. For example "P6M3W5D" will be 6 months, 3 weeks and 5 days from the date of transition into the state. This will override any existing expiration periods.

An existing expiration period can be removed using "clear-expiration".

"clear-expiration"

An existing expiration period can be removed using "clear-expiration".

  • action (clear-expiration )
"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "clear-expiration"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

A new expiration date can be added using "set-expiration".

"set-message"

The trigger action "set-message" creates a message notification and can include a message title and a body.

It can be set as info, warning or error and can be set to auto-close after a specified period or require a read confirmation.

  • action (set-message

  • type (enum) ❗️ Indicator of the level of the message

    • info
    • warning
    • error
  • title (string) For adding a title to the message

  • body (string) ❗️ For adding content for the body of the message

  • tags (enum).  is used as a tag for the message to record the current state when the action occurred.

    • state
  • mode (enum) Message mode. By default, "ack", user will have to acknowledge it, while with "autoClose", it'll disappear after 10s.

    • ack
    • autoClose

❗️ indicates a mandatory parameter -  the message "type" parameter value  and the "body" parameter value are required.

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "set-message",
			"type": "info",
			"title": "Stale content",
			"body": "Content may be out of date",
			"tags": "state",
			"mode": "autoClose"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

All messages can be removed using "clean-messages".

(info)  Custom email notifications can be sent using the "send-email" trigger action.

"clean-messages"

To remove all messages on the content simply add the "clean-messages" action

  • action (clean-messages
"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "clean-messages"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

A message can be set using "set-message".

"remove-restrictions"

The trigger action  "remove-restrictions" will remove content view and edit restrictions for all users/groups.

  • action (remove-restrictions
  • contentId (string) The content id of the page to remove page-level restrictions (if missing, the current page id will be used)

A useful instance would be remove all view and edit restrictions from the final state in a workflow.

"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"final": true}
	],
	"actions":
	[
		{"action": "remove-restrictions"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

Space admins can configure a space workflow in the space tools Document Management dashboard to remove all page level restrictions on transition to the workflow final state.

(warning) Only 'Confluence Cloud Standard, Premium and Enterprise Plans' enable Atlassian Confluence users to edit permissions, including global, space, and page permissions.

"send-email"

The trigger action "send-email" sends a custom email to one or more specified recipients. 

  • action (send-email)
  • recipients (array) ❗️Recipients to send the email to (at least one recipient value must be added). A comma separated list of one or more recipients or Confluence groups is added using:
    • one or more Atlassian userIDs
    • one or more Atlassian groupIDs
    • one or more groupNames
    • one or more user type workflow parameter references
    • one or more group type workflow parameter references
    • one or more Email addresses added in a comma separated list
    • one or more of the following value references can also be added in a comma separated list as a value for the send-email action recipients

      • @watchers  (info) Note that @watchers refers to the watchers set at a document level, not including the watchers of the space.
      • @lastUpdatedBy

      • @creator

  • notification (object) ❗️ Notification holder. Can include the following as a comma-separated list within curly brackets:
    • the email subject
    • title
    • body
  • emailContext (object) Email context object: ${content.title} | ${content.link} | ${content.space} 
    • These can be used in the subject, title and body parameter values. You must include an email subject value and body value.

❗️ indicates a mandatory parameter - at least one value for "recipients" must be specified and the "notification" holder must include at least one of "subject", "title", or "body"

† Each Confluence user must be specified individually using {"user":"userID"}

  • add multiple Confluence users in a comma-separated list {"user":"userID_One"},{"user":"userID_Two"}, ...

‡  & ‡‡ Each Confluence group must be specified individually using {"group":"groupID"} and/or {"group":"groupName"}

  • add multiple Confluence groups in a comma-separated list {"group":"groupID_One"},{"group":"groupID_Two"},{"group":"groupName_Users1"},{"group":"groupName_Users2"}, ...


"triggers":
[
	{"event": "on-change-state",
	"conditions":
	[
		{"state": "Review"}
	],
	"actions":
	[
		{"action": "send-email",
			"recipients":
			[
				"@creator",
				"@watchers",
				"@lastUpdatedBy",
				"@group_type_parameter_1@",
				"@group_type_parameter_2@",
			 	"@user_type_parameter_1@"
				"@user_type_parameter_2@",
				"email_1@email.com",
				"email_2@email.com",
				{"user": "user_ID_One"
   				},
   				{"user": "user_ID_Two"
   				},
   				{"group": "group_ID_One"
   				},
   				{"group": "group_ID_Two"
   				},
   				{"group": "group_Name_Users1"
   				}
   				{"group": "group_Name_Users2"
   				}
			],
			"notification": {"subject": "${content.title} is In Review State",
				"title": "${content.title} is In Review State",
				"body": "Hello, ${content.link} in the ${content.space} space is in approval state and needs to be reviewed"}}
	]}
]

(info)  If adding the JSON trigger using workflow builder there is no need to include the opening "triggers": JSON markup notation, since it will be added by workflow builder.

On screen notification messages can be created using the  "set-message" trigger action.

(blue star) Workflow trigger-generated email 'failure to send' errors are included in the Confluence log.

Related Pages