Jump to content
  • Freshservice Integration - 3.3 - Check Status

    Freshservice Integration - 3.3 - Check Status

    VBScript   Lua

     

    This GSE action checks the status of an existing ticket.

     

    Example call routing scripts can be found here A.3 - Example: Check Status, here A.4 - Example Check Status and Create Note. and here A.5 - Example: Check and Announce Status.

     

    image.png

     

     

    Configure action parameters

     

    image.png

     

    By double clicking a parameter in the list, you can edit it.

     

    Domain Required

    This is the name of your subdomain in the Freshservice URL of your support portal, for example: https://domain.freshservice.com
    This is a string value.

     

    APIKey Required

    This is the API Key you obtained from your Freshservice Support portal. This is a string value.
    Please refer to 1 - Preparations for more details.
     

    TicketID Required

    This is the id of the ticket you want to check the status of.
    This is a string value.

     

     

    Configure action exits

     

    image.png

     

    Exit 0 (Default)

    This exit will be reached if an invalid issue id was given or any kind of problem occured. It is recommmended to name this exit "Invalid ID/Failed".

    If you reach this exit you can refer to 3.4 - Trouble Shooting to figure what went wrong.
     

    Exit 9

    This exit will be reached if an unknown status was returned by the Freshservice REST API. It is recommended to name this exit "Unknown Status".

    If you reach this exit you can refer to 3.4 - Trouble Shooting to figure the returned status and modify your status mapping.

     

     

    Dynamic Status Mapping

     

    This GSE action provides a flexible mapping of Fresdesk ticket status values to exits of the block. All block exits 1 to 8 are of your free chosing. 

     

    By default this GSE action maps the status values to exits as follows. If nothing changes on the Freshservice side, you don't need to do any modifications. If however FreshService makes changes to their status values or you want another mapping of status values to the exit, you can freely do so. This is the defalut mapping:

     

    Exit    States
    1 Open
    2 Pending
    3 Resolved
    4 Closed
    5 Waiting on Customer
    6 Waiting on Third Party

     

    As already mentioned, you can modify this mapping to your precise needs. Just keep in mind that only the exits 1 to 8 are available to you.

     

    All you need to do is to modify a global variable before you use the Check Status GSE action. This can best be done in a Insert Script Code block.

     

    image.png

     

    The content of the Insert Script Code block is then the definition of the mapping list, which is either a VBScript Array or a Lua Table. In both cases you are free to map any number of states to any exit (1..8).

     

    Lets assume you want to map new states New State A (Freshservice status value 8 ) to exit 7 and New State B (Freshservice status 9) to exit 8. This is the code you need to place into the Insert Script Code block:

     

    For VBScript based call routing:

    UseExit = 0
    
    g_aFreshserviceStatusMapping = Array( _
        "1;2;Open", _
        "2;3;Pending", _
        "3;4;Resolved", _
        "4;5;Closed", _
        "5;6;Waiting on Customer", _
        "6;7;Waiting on Third Party", _
        "7;8;New Status A", _
        "8;9;New Status B")

     

    For Lua based call routing:

    UseExit = 0
    
    g_aFreshserviceStatusMapping = {
        "1;2;Open",
        "2;3;Pending",
        "3;4;Resolved",
        "4;5;Closed",
        "5;6;Waiting on Customer",
        "6;7;Waiting on Third Party",
        "7;8;New Status A",
        "8;9;New Status B"
    }

     

    As you can see, you are absolutely free in terms of the mapping of the different possible states of your service issue to an exit of the Run GSE Action block.

     

    All you need to do is to do your mapping in the Insert Script Code block and afterwards open and name the exits of the Run GSE Action block accordingly.

     

    An example of some own status mapping can be found in A.5 - Example: Check and Announce Status.

     

     

     

    Additional return values (as global variables)

     

     

    g_sLatestFreshserviceTicketID (string)

    This global variable holds the ID of the latest checked ticket after the ok (0) exit has been reached.

    The A.5 - Example: Check and Announce Status makes use of this variable to announce the checked ticket id via AzureTTS (text-to-speech).


    g_sLatestFreshserviceTicketStatus (string)

    This global variable holds the status of the latest checked issue after the ok (0) exit has been reached.

    This is a number value, as returned by the Freshservice REST API.

    g_sLatestFreshserviceTicketStatusName (string)

    This global variable holds the name of the status of the latest checked issue after the ok (0) exit has been reached.

    The name is taken from the above explained status mapping, as the Freshservice REST API returns a number value only.
    The A.5 - Example: Check and Announce Status makes use of this variable to announce the status via AzureTTS (text-to-speech).

     

    g_sLatestFreshserviceTicketModified (string)

    This global variable holds the latest modification date of the latest checked ticket after the ok (0) exit has been reached.

    The date is as the Freshservice REST API provides it in UTC/GMT, e.g. "2024-09-20T13:02:03Z".

     

    g_sLatestFreshserviceTicketModifiedReadable (string)

    This global variable holds the latest modification date of the latest checked ticket after the ok (0) exit has been reached.
    The date is in a better readable format and ceonverted to local time, e.g. "20.09.2024 15:02:037".

    The A.5 - Example: Check and Announce Status makes use of this variable to announce the latest modification date via AzureTTS (text-to-speech).

     

     

     


    Tom Wellige
     Share


     Share




×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.