Change Conversation as "Private" when the external user replies to the Request

Change Conversation as "Private" when the external user replies to the Request

Recently one of our customers had the requirement to change the conversation to "Private" when the external user replies to the request.
Customer's workflow:
The request is created by a user who is inside the application.
Now the admin is forwarding the request to the external user and when this external user replies to the request---> Conversations are marked as public since when the external user replies he will be created as a user inside the application and hence the conversations are shown in public as this is the behavior.

We can achieve the customer's requirement with the help of deluge script:
Steps:
1. Admin--->Custom Functions--->Global Function.
   Create a global custom function as mentioned in the below image.
Note: Update the URL and Technician Key.

2. Admin--->Custom Function--->Notification Custom Function
    Create a Notification Custom Function as mentioned in the below image:

3. Admin--->Custom Trigger--->Notification Custom Trigger
    Create a Notification Custom Trigger with no condition as mentioned in the below image:


Now when the external user replies to the request, it will be added as a conversation in the request and the conversation will be in private.

Note: When the external user replies to the request, the External user's mail address should be added in the To or in the CC field
For eg: if reqi@outlook.com is an external user and he replies to the request, the external user must add his mail address in To field along with the incoming mail address.

Attached the script.

                  New to ADSelfService Plus?