Last updated: 2021-05-12
Overview
Perform operations on spaces in Google Chat via the Workflow Automator
Description
Orchestration apps let you automate repeatable tasks and actions that span across a diverse set of systems and applications using workflows. The list of actions supported for this app include:
Space Management
1. Get Space
2. Get Members from Space
3. Get Message
4. Create Message
5. Update Message
6. Delete Message
7. Export File to Freshservice Ticket
8. Export File to Freshservice Ticket Note
9. Upload Ticket Attachments to Drive
Installation Prerequisites
To install and authenticate the app in the orchestration centre, the user(admin) needs to fill in the following credentials:

Before proceeding to retrieve the above credential, the user must have the bot configured in their Google account.
Following are the steps to set up the chatbot (It is necessary to create a bot for orchestration app to interact with Google Chat)
Get started with setting up Google chatbot:
1. Go to Apps Script Getting Started page

2. Click the Hangouts Chat Bot template. You might have to scroll down to see this template. Clicking on it will open the google chat script.

3. Click Untitled project at the top left & name it (Save this name for further reference) and click Rename. This is also the name of your chatbot.

Make sure you are signed into the correct Google account (admin account) when you open the above Apps Script template. The current account can sometimes be switched to your default account without your notice.
You now have a working bot code.
User (admin) will have to generate a deployment ID. User (admin) needs the Deployment ID for this Apps Script project so that one can use it in the next step.
Following are the stepsto get the Deployment ID:
1. Click Publish \> Deploy from manifest

2. In the Deployments dialog box, click on Get ID

3. From the popup after clicking on Get ID, copy the value listed for the Deployment ID and save it as a note.

Note: You can use the HEAD deployment for simple testing during development. But bots with HEAD deployments cannot be shared across a domain and cannot be accessed by users unless they have read access to your script. Therefore for general testing and release, you must create a versioned deployment.
Now we are ready to set up the google project and retrieve the service account credentials for the orchestration Center.
Retrieving service account credentials and setting them up can be divided into 5 steps:
Now, navigate to https://console.cloud.google.com/apis/dashboard
1. Creating a new project or selecting an existing one:

2. Creating a service account and generating service account credentials:

3. Copying service account credentials:

Note: Please save the service account credential copied here, this will be used while setting up google chat in orchestration Center
4. Enabling the google chat API

5. Configuring the Bot with enabled Google Chat API
- Below is the gif to configure the bot with Google Chat API and also a description of the input value to be filled in the fields

Testing if the entire configuration has been set up successfully:
Run the sample (This step is required to publish bot so that it is available to Google chat space, rooms and individuals. Once it is published successfully, the bot is ready to be used with orchestration)
To run the sample, do the following:
1. Create a new direct message with the bot by clicking Find people, rooms, bots ( https://chat.google.com/) and type ‘Freshservice Bot

2. In the new direct message with the bot, type 'hello'.

3\. The bot thanks you for adding it and echoes your message indicating the account has been set up completely and can be orchestrated from the Freshservice orchestration centre.

Usecases
Now that you've successfully installed the Google Chat orchestration app, please have a look at the sample use case below to show how the app can be used efficiently.