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:  

  • Config Name (A custom name given by a user to differentiate the configurations)

  • Service Account 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

 

       

 

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

  1. 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 steps to get the Deployment ID:

  1. Click Publish > Deploy from manifest

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

  1. 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:

  • Creating a new project or selecting an existing project 

  • Creating a service account & generation service account credential

  • Copying the service account credential from the JSON created

  • Enabling the Google Chat API

  • Configuring the Bot with enabled Google Chat API

Now, navigate to https://console.cloud.google.com/apis/dashboard

  1. Creating a new project or selecting an existing one:

  • Below is the gif to create a new project or else open an existing project.

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

  • Below is the gif that will generate a JSON file at the end of it.

  1. Copying service account credentials:

  • From the JSON file generated, copy the entire content inside the JSON file and save it in a note. The entire copied content is your service account credential to be filled in as input in the orchestration Center. Below is the gif for the same.

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

  1. Enabling the google chat API

  • Below is the gif to enable Google Chat API

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

  • In the Bot name field, enter the name of the chatbot defined in the earlier step

  • In the Avatar URL field, enter “https://goo.gl/yKKjbw”

  • In the Description field, enter “Freshservice bot”

  • Under Functionality, select Bot works in direct messages.

  • Under Connection settings, select Apps Script project and paste the.

  • Under Permissions, select Specific people and groups in your domain, and enter your own email.

  • When you have finished configuring your bot, click Save.

 
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

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