Blended Conversation Automation Sample along with request creation via Webhook

Blended Conversation Automation Sample along with request creation via Webhook

Blended Conversations allow you to design possible user interactions and predefine Zia’s responses to common queries.

With its low-code GUI builder, you can guide end users through their questions and automate frequent processes by designing tailored workflows. These workflows integrate seamlessly with the Zia Chatbot, significantly enhancing Zia’s self-service capabilities and improving the overall user experience.

To know more about blended conversations, https://help.sdpondemand.com/blended-conversation

Notes
If you're only looking to create a request via the ZIA chatbot, you can skip ahead and follow Steps 7 to 12 directly.

Scenario for blended conversation :-

An end user is experiencing issues with his Outlook Desktop app — new emails are not syncing, and he is unable to send or receive messages. Instead of calling the helpdesk, John uses the self-service ITSM chatbot (Zia) integrated into the company’s service portal.

User: Hi, my emails are not syncing.

ZIA: I’m here to help! Let’s go through a few quick questions.

1️⃣ Which email client are you using?

  • Outlook (Desktop)

  • Outlook (Web)

  • Gmail

  • Mobile Mail App (iOS/Android)

  • Other (please type)

 User: Outlook (Desktop).

2️⃣ ZIA : Thanks ..! Is this happening on :

  • One device

  • Multiple devices

User:  One device.

3️⃣ ZIA: Got it.

   How long have you been facing this issue?

  • Today

  • Last few days

  • More than a week

User: Today.

Chatbot: Thanks for the details.

4️⃣ ZIA : Select the impact from the options listed below:


(The bot should dynamically list the options from the impact field)

5️⃣ ZIA: Do you see any error messages or codes?

  • Yes

  • No visible error

User:  Yes

6️⃣ ZIA : Please upload a screenshot showing the problem (Outlook inbox, sync error, etc.).

 User uploads: outlook_error.png

ZIA: Screenshot received!

Before I create a ticket, let’s check:

  • Have you checked your internet connection?

  • Have you tried restarting Outlook or your device?

  • Have you changed your email password recently?

ZIA : Did you check these?

  • Yes, I checked

  • No, I need help

  • Not sure

User: Yes, I checked.

ZIA : Thanks for confirming!

I will now create a support ticket for you.

Your ticket has been created!
Request ID: INC-123456 (example)

 

Notes
Before configuring the blended chatbot, it’s advisable to first draft a script like above or define the end goal. This gives you a clear understanding of the intended flow and functionality, making the configuration process smoother and more efficient.

Set up Local Variable before the session

 Step 1  : Click the @ icon in the LHS panel as shown below, then select Add Local Variable. This allows you to define local variables such as username, user ID, and user email. These variables can then be reused in welcome blocks, webhook blocks, and other components to dynamically append user-specific information.

    

 

 Step 2  :  As per the below script, lets use message block "Text" containing Hi @username (by clicking variable in the bottom right corner of the text box) with the welcome message.

Note :- Kindly use the Info Card If you'd like to display information in a card containing images and text.

 

 

 Step 3  :  Create the following script as the next step:,

a. The next step involves asking a question with multiple selectable options for the end user. For this, use the Choice Block with the type set to "Button" and enter the question:
"Which email client are you using?"

b. Choose "Single Button" if the question allows only one answer, or proceed with "Multiple Buttons" for multiple choices. Name this block as "Email Client"—this will automatically generate a corresponding variable that can be used in other blocks.

c. If you want all options to follow the same flow, uncheck the "Create Path" toggle. If each option should lead to a different path or action, enable the toggle.

Note: You can preview each block as needed. Additionally, multiple button types can be used as shown below: (You can list them here with examples if needed.)

 

 

                   

 

 Step 4 : Repeat the above step using the choice block "Button" to ask the question "Is this happening on" in order to verify the number of devices the issue is affecting.

 

 Step 5 : The next step is also a similar question type, used to display relevant options and collect a response from the end user.

Info

You can also repeat the steps by simply copying the block and updating the content as needed.When you copy the block, kindly ensure to rename it, as it will retain the previous block's name with "_copy" appended, which may cause confusion.

You can also change the button type to URL if you have any FAQs hosted on a specific URL, and end the block accordingly.

 

 

 

 Step 6 : Now, we need to display the "impact" (default field) values dynamically, fetched directly from the instance.

To do so, add a Webhook from the Action Blocks section as shown below.

  1. Name the Webhook Block appropriately.

  2. Select the Method as "GET".

  3. In the URL field, enter: @{serverURL}/app/@{appName}/api/v3/impacts

Note: Inside the URL field, type @ to access and insert variables like serverURL and appName. These should appear in blue when correctly referenced.

  1. Then, select the connection "sdpondemand". If it's not listed, click Refresh or Add Connection to configure it.

 

e. Edit the gear icon in the response section to set the status code to "200". Then, update the flow variables, response values, type, and data type exactly as shown in the screenshot. Finally, click Save.

     

 


InfoProceed with Multi Path if you'd like to follow a different flow based on an error response. Otherwise, uncheck the Multi Path option.

f. Now, we need to display the GET response from the above webhook call as a button in the GC flow. To do this, select the Dynamic Button from the Choice Blocks as shown below.

 

 Step 7:  The next step follows a similar script to collect input from the end user, so repeat the above process. However, this path should branch into two different flows:

  • One response should prompt the user to upload a screenshot, then create a request.

  • The other response should directly create a request.

Therefore, ensure that "Create Path" is checked to configure these separate flows.

 

 Step 8 : Now, let's proceed with the "Yes" path to collect a screenshot of the error message from the end user. Perform a File Upload Webhook call to upload the file, and use the uploaded file as an attachment when creating the request.

When the end user selects "Yes", we need to collect the screenshot of the error message. To do this, proceed with the Question Block type "File", as shown below.

 

Step 9: Now, trigger a Webhook call to post the file uploaded by the end user.

    

 

  1. Name the Webhook Block appropriately.

  2. Select the Method as "POST".

  3. In the URL field, enter: @{serverURL}/app/@{appName}/api/v3/requests/_uploads

Note: Inside the URL field, type @ to insert variables like serverURL and appName. These should appear in blue when correctly referenced, as shown below.

 


            

      d. Now, select the Body type as "File Upload" as shown below. Update the Key to "filename", and in the Value field, type @ to select the screenshot variable. Once done, click Save.

             

e. Now, select the connection "sdpondemand". If you don’t find it in the list, click Refresh or Add Connection to create a new one.

   

f. Now, click the gear icon of the Formatter, paste the script provided below, and then click Save.

result = Map();

if(response.get("files").size() > 0)

{

for each  file in response.get("files")

{

result.put("file_id",file.get("file_id"));

}

}

return result;

           

g. Now, edit the gear icon in both the Response and Status Code sections.

  • In the Status Code box, enter "200".

  • For the Flow Variable and Response Value, set the value as "file_id".
    Then, click Save to apply the changes.

 

     

h. Now, uncheck the Multi Path option and click Save.
Note :- You have now successfully created a webhook call for file upload. You can preview the block by uploading a test file and verify the result to ensure the configuration is working correctly, as shown below.

            

 

 Step 10 : As shown in the script below, display a confirmation message on the screen to inform the end user that the screenshot has been received, along with the next steps to follow before escalating the issue.

  

 Step 11 : Now, repeat the Choice Block process to get confirmation from the end user on whether they have followed the mentioned steps. Use the Button block for this, as shown below.

 Step 12 : As per the script below, display a confirmation message using the Message Block to inform the user that the request is being created.

 Step 13 : As the final step, create a Webhook POST call to create a request, including the screenshot as an attachment from the previously uploaded file via the file upload webhook.

  1. Click on Webhook from the Action Blocks and name it "Create Request".

  2. Now, select the Method as "POST".

  3. Below is the Webhook URL format along with the input data:

https://sdpondemand.manageengine.com/api/v3/requests?input_data={"request":{"template":{"id":"94980000013980249"},"status":{"id":"94980000000006657"},"impact":{"name":"@{impact_button}"},"udf_fields":{"udf_char662":"@{EmailClient}","udf_char664":"@{duration}","udf_char663":"@{devices}"},"requester":{"id":"94980000000104330"},"assets":[],"site":{"id":"94980000000120077"},"subject":"Mail Sync Issue","description":"Enter your subject","attachments":[{"file_id":"@{file_id}"}]}}

Warning
  1. Ensure there are no spaces in the URL, as this can lead to errors. To verify, move the cursor using the keyboard through the URL field to detect any hidden spaces.

  2. Replace the highlighted variables with the block name you added while creating the block by clicking @ symbol and selecting the appropriate variables.

  3. The ID and UDF values shown are based on the test instance used. Make sure to replace them with your own UDF, template ID, and requester ID from your instance.

  4. To make it easier, you can add all the required variables directly into the description box, instead of appending them to UDF fields. You can also use a Text Block to collect any additional input from the end user.

 

Idea

The easiest way to get the complete webhook URL and input data without typing manually is to create a sample request in your instance while keeping the Network tab (in browser dev tools) open. Then, capture the request call under the Headers and Request (Form Data) section.

Sample Webhook URL with all the attributes added :-

https://sdpondemand.manageengine.com/api/v3/requests?input_data={"request":{"template":{"id":"94980000000006655"},"priority":{"id":"@variable"},"request_template_task_ids":[],"requester":{"id":"@session_variable"},"email_ids_to_notify":[],"site":{"id":"94980000000120077"},"assets":[],"category":{"id":"94980000008578183"},"impact":{"id":"94980000013148617"},"subcategory":{"id":"94980000008578185"},"urgency":{"id":"94980000002737019"},"item":{"id":"94980000008578187"},"group":null,"status":{"id":"94980000000006657"},"technician":null,"subject":"Customize+with+your+Subject","description":"@Variable","scheduled_start_time":null,"scheduled_end_time":null,"created_time":null,"due_by_time":null,"first_response_due_by_time":null,"udf_fields":{"udf_char20":null},"attachments":[{"file_id":"8599003"}],"resolution":{"content":""}}}`

 

d. Now, select the connection "sdpondemand" from the available connections.

e. Click the gear icon next to the Formatter, paste the provided code into the editor, and then click Save.

result = Map();

result.put("subject","null");

result.put("description","null");

result.put("requester","null");

result.put("technician","null");

result.put("status","null");

result.put("id","null");

result.put("display_id","null");

if(response.get("requests").size() > 0)

{

for each  request in response.get("requests")

{

result.put("subject",request.get("subject"));

if(request.get("description") != null)

{

result.put("description",request.get("description"));

}

else

{

result.put("description","-");

}

result.put("requester",request.get("requester").get("name"));

if(request.get("technician") != null)

{

result.put("technician",request.get("technician").get("name"));

}

else

{

result.put("technician","Not assigned");

}

result.put("status",request.get("status").get("name"));

result.put("id",request.get("id"));

result.put("display_id",request.get("display_id"));

}

}

return result;

               

f. Now, click the gear icon in the Response → Status Code section.

  • Set the Status Code to "201".

  • Update the Flow Variables / Response Values to "display_id". exactly as shown below. Then, click Save. 

  •           

     Step 14 : Let’s add the End Card using a Message Block to display the final message, as shown in the script below.

                   

     Step 15 : As per Step 6, we followed the "Yes" path. Now, we’ll proceed with the "No visible error" flow, which does not require any file upload, as it only needs to create a request and display an end message block.

    Since the request creation was already configured in the previous block, you can simply copy the "Create Request" webhook block and remove the attachment variable from the input data within the URL space, as highlighted below.

     

     Step 16 : Copy the end message block and place it right after the Create Request webhook block, as shown below.
    Also, make sure to update the copied Display ID by clicking the @ symbol and selecting the appropriate variable.

     

    Points to Remember:


1. Be cautious of extra spaces in the Webhook URL, especially where you insert block variables — use the keyboard arrow keys to spot hidden spaces.

2. Make sure to remove the attachment field if you're only looking to create a request using the Webhook POST call without file uploads.

3. The above scenario is just a sample use case. You can explore and use other blocks based on your requirements.

​​​​​To learn more about the available blocks and their usage, refer to the official documentation or help guide, https://help.zoho.com/portal/en/kb/desk/self-service/guided-conversations/general/articles/components-of-the-gc-flow-builder#Using_the_Text_editor_in_Blocks



                  New to ADSelfService Plus?

                    • Related Articles

                    • General - Request FAQ's

                      For detailed configuration steps, please refer to our help guide. 1. An user reports seeing "Not Authorized" in certain fields within the request list view. How should I address this issue Kindly navigate to the Set up --> Templates & Forms and edit ...
                    • Order of Automation Execution During Request Creation

                      When a request is created in the application, various automation layers are executed in a specific sequence. Understanding this order is essential to determine the appropriate level for applying automation and troubleshooting in case of failures. ...
                    • Zoho Flow - Automation Samples

                      Leverage Zoho Flow actions, an intuitive no-code solution to enhance triggers and workflows in ServiceDesk Plus Cloud. This enables seamless automation across third-party cloud applications. For example, you can configure a Zoho Flow action with a ...
                    • Request Details Page

                      View Request Details The request details page contains all the details relevant to a request. The request details are structured to help technicians access information instantly. Each element in the request details page is tailor-made to simplify the ...
                    • Business Rule Scenarios

                      Business Rule Scenarios Set up → Automation → Business Rules Business rules can automate IT tasks and are site-specific. 1. Each site requires a separate Business Rule (BR) due to its site-specific nature. Therefore, site criteria will not be found ...