Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Returning Divisions

    Posted yesterday

    Has anyone come across a way of searching for a division, and more specifically by a date/time order? We currently have to check via a JSON path using $..divisionIds[*] if it Contains the Division ID.  As the trigger needs to be activated per Division, it would be nice if I can check for a specific Division in a specific place so that I could see if the call came in or was answered or transferred to another Division. The JSON path option returns all Divisions in alphabetical order.

    Currently the above is not an issue, but it would be helpful if we could search for a specific, or lack of a specific Division and order it by time it was captured


    #Triggers

    ------------------------------
    lee fairweather
    Solution Architect
    ------------------------------


  • 2.  RE: Returning Divisions

    Posted 23 hours ago
    Hi,
     
    I have not implemented this exact scenario using `divisionIds`, but I worked on something similar where the goal was to preserve the chronological path of a call as it moved between queues.
     
    In that case, agents could transfer calls to queues that belonged to different divisions. The division itself was not our main reference because it was already associated with the queue.
     
    Every time the call was transferred, we sent the conversation information to the customer's API. The payload contained the conversation ID, queue information, transfer details, and the event timestamp.
     
    Their CRM received these events, organized them chronologically, and maintained the complete history of the interaction. That history was later returned to Genesys and displayed in the agent script, so the next agent could see where the call had already passed.
     
    Thinking about your Trigger-based scenario, I would probably follow a similar approach instead of relying on the position returned by `$..divisionIds[*]`.
     
    The Trigger could capture each relevant event and start a Workflow that sends information such as:
     
    `conversationId | queueId | divisionId | eventType | timestamp`
     
    The external system could then use the timestamp to organize the events and create the chronological journey you are looking for.
     
    Participant Data could still be useful for maintaining the current context during the interaction or making some information available in the agent script. However, for a complete history with multiple transfers, I would prefer sending each event to an external API or CRM rather than continually updating a single Participant Data attribute.
     
    Another option for post-interaction validation would be to use:
     
    `GET /api/v2/analytics/conversations/{conversationId}/details`
     
    From there, you could reconstruct the route using the participants, sessions, and segments, sorting the relevant records by their start timestamp.
     
    One point I would keep in mind is that Trigger Workflows should not rely only on the order in which they are executed. Events may be processed close together or arrive out of sequence, so I would let the external system sort them using the event timestamp and also handle possible duplicate events.
     
    It is not exactly the same implementation, but the objective was very similar: capture every transfer, preserve the chronological journey, and make that information available to both the agent and the external system.
     
    I also cross-referenced a few points in the Genesys Cloud Resource Center while reviewing your scenario. I hope this gives you another practical option to explore.



    ------------------------------
    Raphael Poliesi
    ------------------------------



  • 3.  RE: Returning Divisions

    Posted 16 hours ago
    Edited by Phaneendra Avatapalli 16 hours ago

    Hi Lee,

    From my understanding, Trigger conditions evaluate the event payload using JSONPath, but I haven’t found a way to query the divisionIds array based on the order or timestamp in which the divisions were captured. Using $..divisionIds[*] returns the matching division IDs, but it doesn’t appear to support chronological evaluation.

    If your logic depends on the sequence of division changes (for example, identifying the division at answer versus after a transfer), you may have more flexibility by keeping the trigger simple and handling that evaluation in an Architect Workflow after the trigger fires.

    Hope this helps!

    Reference: https://help.genesys.cloud/articles/overview-of-triggers/