Cloud Migration Resources
Planning a Cloud migration? These resources can help you get started:
→ Comala Document Management Cloud features – Review Cloud features and understand key differences between DC and Cloud.
→ Migration support from Appfire – Learn how we can help you migrate smoothly.
set-restrictions trigger action
Overview
You can use the Set Restrictions action in a workflow trigger to remove existing Confluence page-level restrictions before applying new ones. This can be useful when an approval occurs or when a document transitions to a different workflow state.
The Set Restrictions trigger action lets you remove all existing page-level restrictions for a specific Confluence permission type and apply new restrictions in a single action.
A separate Set Restrictions action is required for each of the following:
Removing existing view permissions and defining who can view the document
Removing existing edit permissions and specifying who can edit the document
To remove and add both view and edit restrictions in a workflow trigger, include a Set Restrictions action for each restriction type.
Set Restrictions action parameters
Action Parameter | Value | Notes |
|---|---|---|
Type MANDATORY | Existing type of Confluence page-level permissions to be removed and added:
You must add a separate action for each type of permission. | Removes the existing specified type of permission restrictions and then restricts the permission to the specified users. Only one type of permission can be specified in each action:
|
Restrictions MANDATORY | One or more users added using one or more of the following fields
At least one value must be added to one of these fields. | Restrictions must be applied to at least one user. |
User | One or more Confluence users. | List of Confluence users
|
Confluence Smart Values | One or more of the following:
| List of Confluence Smart values. |
Workflow user type parameters | One or more workflow group type parameters. | List of workflow user type parameters
|
Group | One or more Confluence user groups. | List of Confluence user groups
|
Workflow group type parameters | One or more workflow group type parameters. | List of workflow user type parameters
|
When the workflow trigger Event occurs, the trigger checks that any required Conditions are met, and if met, the Set Restrictions action removes existing Confluence page-level view or edit restrictions and adds page-level content view or edit restrictions specified in the action to the current page.
“set-restrictions” JSON code
A Set Restrictions workflow trigger action added using the visual editor is automatically displayed in the workflow code editor as a “set-restrictions” trigger action.
You can also use the code editor to add the workflow trigger and the “set-restrictions” action.
"set-restrictions" parameters and workflow trigger code example
"set-restrictions"
The trigger action "set-restrictions" removes document view or edit restrictions for all users and adds view or edit restrictions for specified users.
action (set-restrictions)
type ! Type of permission to apply. Only one permission type can be added in each action.
view - remove all existing view restrictions and then assign view restrictions to one or more users or user groups
edit - remove all existing edit restrictions and then assign edit restrictions to one or more users or user groups
restrictions ! List of users and groups with the specified type of permission. At least one user or one user group must be specified
user - comma-separated list of Confluence userIds, Confluence ser type workflow parameters, Confluence value references*, or metadata
{“user”: [ “userID”, @user_parameter@, @creator, @lastUpdatedBy, @watchers ]}
group - comma-separated list of Confluence groupIds, Confluence group name, group type workflow parameters, or metadata
{“group”: [ “groupID”, "groupName", @group_parameter@ ]}
❗️ Mandatory parameters
type
The "type" parameter value must be included. The view or edit value must be added
restrictions
The "restrictions" parameter value must be included. At least one value must be added for either the user or group parameter
Invalid values for the user or group parameter are ignored.
*Supported Confluence value references
Only the following value references are supported in Confluence Cloud:
@creator
@watchers
@lastUpdatedBy
Example trigger code
"triggers":
[
{"event": "on-change-state",
"conditions":
[
{"state":"Expired"}
],
"actions":
[
{"action": "set-restrictions",
"type": "view",
"restrictions":
[
{"user": [ "5d52a37ef0f22a0da2d6f070", @creator ]}
]
},
{"action": "set-restrictions",
"type": "edit",
"restrictions":
[
{"user": [ "confluence-editors", "@qa_editors@" ]}
]}
]This trigger action is typically used when a state change occurs to remove all existing page-level restrictions for a specific Confluence permission type and apply new restrictions in a single action. You must use a separate "set-restrictions" action for each type of permission:
remove view permissions and define new view restrictions
remove edit permissions and define new edit restrictions
Only 'Confluence Cloud Standard, Premium, and Enterprise Plans enable Atlassian Confluence users to edit permissions, including global, space, and page permissions.