Sending an email on on-approve  event if one of the assignees approves the page

A JSON trigger can be configured to send an email when a user undertakes an approval decision. The trigger consists of

  • the on-approve event
  • the state condition to specify the approval state
  • the send-email action
"triggers":
[
  {
    "event":"on-approve",
    "conditions":
	[
      {
        "state":"Review"
      }
    ],
    "actions":[
      {
        "action":"send-email",
        "recipients":[
          "@creator",
		  {"user": "5fa406b044658b0071653189"
		  },
		  {"user": "4da601b0165318944658b007"
		  }
         ],
        "notification":{
          "subject":"${content.title} has been approved",
          "title":"${content.title} has been approved",
          "body":"Hello, ${content.link} in the ${content.space} has been approved by one approver"
        }
      }
    ]
  },
]

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

eventon-approve
  • trigger will only listen for a user approve decision - condition added to constrain the event to the Review state
conditionstate: Review
  • state condition for the trigger event
actionsend-email
  • email sent to the content author (@creator) and two Confluence users using their userId. An email is sent for each approval decision by a user

on-approve and on-reject multiple event trigger

"triggers":
[
  {
    "event":"on-approve",
    "conditions":[
      {
        "state":"Review"
      }
    ],
    "actions":[
      {
        "action":"send-email",
        "recipients":[
          "@creator",
		  "@QualityReviewers_workflow_parameter@"
        ],
        "notification":{
          "subject":"${content.title} has been approved",
          "title":"${content.title} has been approved",
          "body":"Hello, ${content.link} in the ${content.space} has been approved by one approver"
        }
      }
    ]
  },
  {
    "event":"on-reject",
    "conditions":[
      {
        "state":"Review"
      }
    ],
    "actions":[
      {
        "action":"send-email",
        "recipients":[
          "@creator",
		  "@QualityReviewers_workflow_parameter@"
	    ],
        "notification":{
          "subject":"${content.title} has been rejected",
          "title":"${content.title} has been rejected",
          "body":"Hello, ${content.link} in the ${content.space} has been rejected by one approver"
        }
      }
    ]
  }
]

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

eventon-approve
  • trigger will only listen for a user approve decision - condition added to constrain the event to the Review state
conditionstate: Review
  • state condition for the trigger event
actionsend-email
  • email sent to the content author (@creator) and users who are added as the value(s) for the @QualityReviewers_workflow_parameter@ using their userId. An email is sent for each approval decision by a user

There is a similar email for the on-reject action.