Creating a plugin to automate the approval process is easier than creating a Power Automate Flow. This is because using Flow requires creating multiple connection reference components and conditions checking. The plugin code provided demonstrates how to solve this problem. The plugin retrieves the StageRunId and SPN Client ID, gets the Application User ID based on the SPN Client ID, impersonates the Organization Service based on the Application User ID, and calls UpdateApprovalStatus with the Approval Status set as Approved. The plugin can be registered on the OnApprovalStarted event. The article also includes a demo and screenshots of the result.
Login now to access my digest by 365.Training