This site has moved to the integrated Appfire documentation and information site for our apps.

From February 2024 this site is no longer updated.

Take a look here! If you have any questions please email support@appfire.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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 automatically 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 its value for 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 included for the "change-state" action.

"publish-page"

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

  • action (publish-page)

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

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

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 the state change event the publish-page action macro will publish the content to the target space.

o

The Comala Publishing breadcrumb is updated on the draft page header.

o

The publishing breadcrumb on the target space page will also be updated.

The target space for publishing the page is configured in the Comala Publishing space settings. Publishing may also occur based on the configuration of the Comala Publishing app.

"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) Atlassian userID of the approver

❗️ no mandatory parameter - only the approve action is required.

† If no approval is specified in the trigger action, the default approval is the approval in the state named in the trigger event condition. If there are multiple approvals in the state, the default approval is the first approval listed in the JSON markup.

"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.

o

"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)  Atlassian userID of the rejector

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

† If no approval is specified in the trigger action, the default approval is the approval in the state named in the trigger event condition. If there are multiple approvals in the state, the default approval is the first approval listed in the JSON markup.

"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.

o

"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

❗️ Mandatory parameters

  • the assignee "user" parameter value must be specified with at least one user unless you instead specify at least one group using the "group" parameter

If no approval is specified in the trigger action, the default approval is the approval in the state named in the trigger event condition.
If there are multiple approvals in the state, the default approval is the first approval listed in the JSON markup for the state.

"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 you can use the "group" parameter, for example "group":"qa_reviewers" where "qa_reviewers" is a Confluence group name.

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.

o

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

The trigger action "unassign" will remove a user or members of a Confluence group from a named approval.

"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 the "clear-expiration" action.

"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 the "set-expiration" trigger action.

"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", a user will have to acknowledge it, while with "autoClose", it'll disappear after 10s.

    • ack

    • autoClose

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

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

 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 above trigger listens for a state change event to the Expired state and will display an on-screen message notification on the change of state.

o

If the "set-messsage" action parameter is "type":"warning" the displayed notification is

o

If the "set-messsage" action parameter is "type":"error" the displayed notification is

o

All messages can be removed using the "clean-messages" trigger action.

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 the "set-message" trigger action.

"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 to use this trigger action to 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.

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 is added using:

    • one or more Email addresses

    • one or more user objects by specifying the Atlassian userIDs

    • one or more group objects by specifying Atlassian groupIDs or the Atlassian groupNames‡‡

    • one or more user type parameters (see workflow parameter references)

    • one or more group type parameters (see workflow parameter references)

    • One or more of the following value references can also be added as a value for the "send-email" action "recipients"

      • @watchers

      • @lastUpdatedBy

      • @creator

@watchers refers to the watchers set at a document level, not including the watchers of the space.

  • notification (object) ❗️ Notification holder.
    You must include at least an email "subject" and "body" as a comma-separated list within curly brackets. The "title" is optional.
    You can embed any of the following as part of the notification text: ${content.title} | ${content.link} | ${content.space}) as values in any of the following parameters

    • "subject"

    • "title"

    • "body"

❗️Mandatory parameters

  • at least one value for "recipients" must be specified

  • 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",
          "@user_type_parameter_1@",
          "@user_type_parameter_2@",
          "@group_type_parameter_1@",
          "@group_type_parameter_2@",
          "email_1@email.com",
          "email_2@email.com",
          {"user": "user_ID_1"},
          {"user": "user_ID_2"},
          {"group": "group_ID_1"},
          {"group": "group_ID_2"},
          {"group": "group_Name_1"},
          {"group": "group_Name_2"}
        ],
        "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 review state."
        }
      }
    ]
  }
]

(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.

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

Related Pages

  • No labels