Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
JSON Triggers

Overview

One or more trigger actions can be set for a named event in the workflow.

When the workflow trigger event occurs the trigger will check that any required conditions are met, and if met the "unassign" action unassigns one or more users as reviewers to a named approval.

"unassign"

Excerpt

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

  • action (unassign

  • approval (string) Name of the Approval to assign. If not specified, default approval will be

    used†

    used

  • comment (string)

     Comment

     Comment for the assignation operation

  • assigner (string) Atlassian 

    user

    ID for the assigneruser ID

    (string) ❗️ Atlassian 

    user

    userID to assign

    (or a user type workflow parameter)

❗️ indicates a mandatory parameter -  the assignee "user" parameter value must be specified with the "unassign" action 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.

Code Block
"triggers":"
[
	{"event": "on-change-state",
	"conditions":
	[
		{state: "Draft"}
	],
	"actions":
	[
		{"action": "unassign",
			"approval": "Triagereview",
			"user": "5d52a37ef0f22a0da2d6f070"}
	]}
]

(info) If adding the JSON trigger using workflow builder there is no need to include the opening "triggers":" JSON  JSON markup notation, since It it will be added by workflow builder.The trigger action "assign" will assign a one or more users from a named approval.At least one user must be specified

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

o

Image Removed

Image Added

Example

We can use the "unassign" action to unassign a user as a reviewer in a state with multiple approvals.

For example in the following Rejected state we have two approvals, each with assigned reviewers.

oImage Modified

Adding the following JSON trigger to the applied workflow using workflow builder

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

    " action removes an assigned user (identified using their Atlassian userID)

As the approval is not named in the trigger action, the assigned user is removed from the default approval, Primary.

oImage Modified

The unassignment un-assignment of the reviewer is recorded in the workflow history document activity for the documentpage.

Image AddedoImage Removed
Info
(info)

In this example, a rejected event for any of the approvals in the named state will cause the "unassign" action to occur. 

Related Pages

JSON

Trigger

events
  • JSON Trigger examples
  • Add a JSON trigger using workflow builder
  • List of trigger actions

    Child pages (Children Display)
    pageJSON Trigger actions