How to create a Service Request for an incoming Email

Version 1

    Details

    The article describes how to create a Service Request for an incoming Email.  There are certain limitations, it must be used as a generic Service Request and it cannot be modified.


    Resolution

        

    The Email listener by default is able to manage Emails for incidents and problems, mapping the parts of the Email to the appropriate fields. If you look into  the help files, you will see that it is possible to receive Emails for other business objects and create automatic records when an Email has been received.

     

    In HEAT Service Management, when a record for a business object has been saved, it does require the value of some fields. For the Service  Requests, the record requires 5 fields, so this information should come in the Email, and it should be formatted for allowing the system to read it properly.

    For example, an Email for a Service Request should have this format (the values would vary):

     

     

    An Email to a user should not be sent this way, so this article proposes a different way to achieve it.

     

    A record is required to be stored as this type of Service Request. It is not possible to create the Service Request and then select the  right offering, the only way is using a generic Request Offering for those received by Email.

     

    Please follow this procedure:

     

    1. Create a mailbox for receiving the Service Request.
    We are going to use this mailbox for receiving the Service Request Emails, and we will store them in the system as an Email, but we do not want the Email listener to process them. It should be configured as in the screenshot, with your own data:

     

     

    Please note the fields highlighted.
    We are assuming that the Emails will come from users where their Emails are stored in the Employee table.  All these Emails can also be viewed from the Email top level tab.

     

    2. Create a generic Request Offering for those received for Email. You can design it in any way, but it can only be one form, so please  try to cover all the possible needs in only one form.
    For this example we have created a very simple Request Offering with only one text-area:

     







     

    Please save and exit.

     

    3. We will need a form for retrieving the values of the following fields that we are going to use to automate the emails: SvcReqTmplLink_Category  - SvcReqTmplLink_RecID - SvcReqSubscLink_RecID

     

    - First turn these fields on so they are  visible. 
    - In the back-end, please go to Business Objects design tool, and access the Service Request Object Fields: 

     

     

     

    - Scroll down and click on the "SvcReqSubscLink" object field

     

     

    - Uncheck the option "Hidden in UI".  Repeat the same procedure for the SvcReqTmplLink object field and Save the changes.

    - Add a new form, so please click on the "Forms" tab

     

     

    - Add a new form, that should be as the one in the screenshot. All the fields are read-only (always):

     

     

    - Go back and access the layout

     

     

    - Access the formview

     

     

    - In the formview, switch to the old view

    - Add the new form as a child panel:

     

     

    - For the column object, you must choose ServiceReq (To Itself), as in the screenshot

     


    4. Now we need to retrieve the data from a dummy request.   Go to Service Request, and create only one for this purpose, using the one created at step 2. 
    - You can delete it after ending the procedure.
    - Once created, please select the "Debug" tab, where you should see the form created in the step 3, as in the screenshot:

     

     

    5. With this data, we are able to create a quick action for converting this email into a Service Request. Open the Email top level tab,  and then in the "Action menu" select "Edit actions"

     

     

    - In the "Create New Actions" tab, select "Insert Child Object"

     

     

    - Please fill the fields as in the screenshot, modifying the values of the first three fields with the values obtained in the step 4.
    - If it is not clear in the image, these are the values for the last three fields:

     

    ProfileLink_Category:        Employee

    ProfileLink_RecID:        $([Employee#.]RecId)

    Description:                $(Subject + " | " + EmailBody)

     


    - Please save the Quick Action.


    6. Finally, we need to automate this Quick Action.  We cannot use a Business Rule for insert as we need to specify a condition, so we are going to create a Workflow for the incoming Emails

     

    - In the AdminUI, access the Workflows and add a new one

     

     

    - For the Journal.Email object

     

     

    - Press save

    - In the next screen add a version.  Wait some seconds, and once it is opened, press the "Configuration" button. 
    - Fill the form as in the screenshot, modifying the value of the email with the account that you are using for the mailbox listener

    - Save.

    - Now, we are going to design the workflow.
    - It is quite simple, just running a quick action and adding a notification if it fails

     

     

    - The Quick Action should be configured in this way, selecting the quick action that was created in the step 5

     

     

    - The notification should be something like the screenshot, modifying the email accounts and the text as you prefer:

     

    - Save the workflow validating it

    - Go back to versions for publishing the workflow

     

     

     

    - Once published, you should see it highlighted in green.

     

    -At this point we could create the Service Request by email, but we want to fill out automatically the fields of it.

     

    Create manually a dummy Service Request filling out these three fields and save it.

    We need the following values to use them in a Quick Action, so it is possible to get them directly from the database, using the following  query:

    SELECT TOP 3  [ParameterDisplayValue], [ParameterName], [DisplayType], [SvcReqTmplParamLink_RecID]

    FROM [dbo].[ServiceReqParam]

    ORDER BY CreatedDateTime desc

     

    From the Service Request top level tab, open the Quick Actions editor.

    Where we are going to create a new “Composite Action”, that in this case is going to be composed by three “Insert Child Objects”  actions (using “ServiceReqContainsServiceReqParam” as Child Object Reference), one per field in the Request Offering. In each action, we are going to include the following values:

    For the first field, we would fill out the values in the following way, as the content is going to be the email received.

    Parameter Name                             The value would be the value of the ParameterName column in the previous step

    Parameter Value                              $(Symptom)       

    ParameterDisplayValue                  $(Symptom)

    SvcReqTmplParamLink_RecID      The value would be the value of the SvcReqTmplParamLink_RecID column in the previous step

    Display Type                                     The value would be the value of the DisplayType column in the previous step

     

    However, the fields 1 and 2, are going to have a value extracted from the email. The email should be written using the following  pattern:

    Where the content of the Field 1 (Field 2 is similar) of the Service Request is delimited by tags “<Field1></Field1>”. The Name and  structure of the tags can vary, but the way of extract the value will depend on the name of the tag.

    Parameter Name                             The value would be the value of the ParameterName column in the previous step

    Parameter Value                              $(Substring(Symptom, Find("<Field1>",  Symptom) + 9, Find("</Field1>",  Symptom) - Find("<Field1>",  Symptom)  - 8))       

    ParameterDisplayValue                  $(Substring(Symptom, Find("<Field1>",  Symptom) + 9, Find("</Field1>",  Symptom) - Find("<Field1>",  Symptom) - 8))

    SvcReqTmplParamLink_RecID      The value would be the value of the SvcReqTmplParamLink_RecID column in the previous step

    Display Type                                     The value would be the value of the DisplayType column in the previous step

     

    As we can see in the previous list, the value of the field is extracted from the email. The command will depend on the name of the  tag and its length.

    Once the Quick Action with the three fields is completed, open the AdminUI and open the Workflows option menu. Add a new one for  the Service Request object, called “Service Request received by email”. We cannot do it as a Fullfillment because that would be fired once the Service Request is assigned to an owner.

    Add a version composed by Start, Quick Action, Task and Stop. It must be fired only for this kind of Generic Service Request, so  we are going to filter it using the RecID of the Service Request extracted from the Debug tab that we are using in the “Create Service Request from Email” Quick Action in the Email Business Object.  Please review the screenshots:

    In the Quick Action block, we are going to run the composite Quick Action that we created before

    Then, we could add a the task like in the example, but it would also be possible to use the extracted values like are used in the  composite action

    Finally, save and publish the Workflow and test the results. It should be something similar to this: