unassign trigger action
Overview
When the workflow trigger event occurs, the trigger checks that any required conditions are met, and if met, the "unassign"
action unassigns one or more users as reviewers to a named approval.
"unassign"
The trigger action "unassign"
unassigns a user to a named approval.
action (unassign)
approval - the name of the approval to assign. If not specified, the default approval† is used
assigner - Atlassian
userID
for the un-assigner (if no value is added, the app add-on user is the un-assigner for the action)user ❗️ Atlassian
userID
to unassigncomment - comment for the assignation operation
❗️ Mandatory parameter
user parameter for the user to be unassigned
The user parameter value must be specified with the "unassign"
action parameter.
† Default approval
If no approval name is specified in the trigger action, the default approval is the approval in the state named in the trigger event condition.
If the state has multiple approvals, the default approval is the first approval listed in the state's JSON markup.
Example trigger code
"triggers":
[
{"event": "on-change-state",
"conditions":
[
{state: "Draft"}
],
"actions":
[
{"action": "unassign",
"approval": "Triagereview",
"user": "5d52a37ef0f22a0da2d6f070"}
]}
]
When adding the JSON trigger using the workflow builder visual editor, there is no need to include the opening "triggers":
JSON markup notation; it is added automatically by the workflow builder.
The Atlassian user Identification Number (userID
) is visible in the URL when viewing the User Profile.
Example
We can use the "unassign"
action to remove a user as a reviewer in a state with multiple approvals.
For example, we have two approvals in the following Rejected state, each with assigned reviewers.
The following workflow trigger, when added to the applied workflow
[
{"event":"on-reject",
"conditions":
[
{"state":"Rejected"}
],
"actions":
[
{"action":"unassign",
"user":"5e6f8b4817c6640c385edb5e",
"comment":"unassigned user"}
]}
]
listens for a rejected event (
"on-reject"
) in the Rejected state ("condition":"state":"Rejected"
)
When a single rejected event occurs:
the trigger
"unassign"
action removes an assigned user (identified using their AtlassianuserID
)
As the approval is not named in the trigger action, the assigned user is removed from the default approval, Primary.
The un-assignment of the reviewer is recorded in the document activity for the page.
In this example, a rejected event for either of the two approvals in the named state causes the unassigned action.