Approval Flow Configuration
- kavitha (Unlicensed)
- Jeyanthi (Unlicensed)
- Susmita Bhattacharjee (Unlicensed)
Enable Approval Flow
Want to know more about enabling approval flow in Slack or HipChat? Then you have landed on the right page.
For Approval flow in slack, Bot must use slack app. Bot added though hubot configuration will not have this feature
- Logging into api.slack.com navigating to the My Apps section at slack.com/apps
- Click the Interactive Components link in the menu
- Click Enable Interactive Messages, enter Request URL and click Enable Interactive Messages
The Request URL must be publicly accessible and secure. - Click the Bot users link in the menu.
- Click Add a Bot User, enter Display name and Default username and click Add a Bot User
- Click the OAuth & Permissions link in the menu.
- Go to Redirect URLs section click Add a new Redirect URL, enter Redirect URL and click save changes.
The Redirect URL must be publicly accessible and secure. - Go to scopes section and select “Administer the workspace” scope and click save changes.
- Click on the Install App to Team button found on the Install App If new permission scopes or Slack app features are added after an app has been installed, app has to be reinstalled to workspace for changes to take effect.
- Once the app installed, the access token will be generated in OAuth & Permissions page
- Sign in to the hipchat account and click the Integrations link from top menu
- Select a channel from the dropdown to which the approval flow configuration is to be made and click Build your own integration block to proceed further
- Once Build your own integration is selected, name the integration and click create button to create the integration
- when the integration is created, configuration can be added now. Select the checkbox Add a command enter your slash command (This command should be used for approving or rejecting an action)
- Enter a post URL where the flow should be redirected
- Click save to make the changes to come effect
There should be two integration installed in order to handle the approval and rejection flow separately. Name the slash command such a way to identify whether it’s an approval flow command or rejection flow command
Mattermost doesn't need any extra configuration for approval flow othere than changing the admin channel details in workflow.json. You should have a separate public channel where approval requests will go and that channel name should be provided to workflow.json.To obtain the workflow.json related details of your mattermost public channel, click on your approval channel on the left pane → Click on channel name at the top → Select View Info from the dropdown → Copy the last word from the URL field shown, this is the data required for workflow.json as admin and adminid field.
For Approval flow, it is necessary that the AllowEditPost property in Mattermost config.json should be enabled (Refere here). This is required because the approval/rejection happens through attachments which are updated( or edited) after the approver clicks Approve/Reject button.
Microsoft Teams doesn't need any extra configuration for approval flow other than changing the admin channel details in workflow.json. Create connector for the admin channel where requests are to be posted and set the details in workflow.json adminid field. Also, create a connector for the channel where the bot should reply after the approval/rejection of the request submitted to admin. Since post approval flow communication from bot requires connectors(webhooks), as of now approval flow is feasible from channels only, not from peer to peer chats. However, normal communication with bots are possible using peer to peer chats.
Example adminid filed in workflow.json:
"admin":"Admin",
Connector/ Incoming Webhook creation reference: https://docs.microsoft.com/en-us/outlook/actionable-messages/send-via-connectors and https://www.sherweb.com/blog/office-365-connectors-microsoft-teams/