Genesys Cloud - Main

 View Only

Sign Up

  • 1.  Scripter – Trigger custom action after transfer to another agent

    Posted 8 days ago

    Hi everyone,

    I'm looking for a supported way to trigger a custom action in a Genesys Cloud Agent Script when an existing voice interaction is transferred to another agent.

    Our current setup works like this:

    • Agent A receives the interaction.

    • The assigned script opens correctly.

    • A Page Load Action performs some initialization and pushes one or more URLs.

    • We store flags such as URL1_Pushed = true to prevent the same URL from being pushed again if the script is reloaded.

    • The interaction is then transferred to another queue and Agent B receives it.

    The issue is that Agent B does not receive the URL push.

    During testing we found that:

    • Scripter.Agent Participant ID correctly changes from Agent A's participant ID to Agent B's participant ID.

    • The existing script and its conversation input/output variables are retained, which is exactly what we want.

    • However, the Script Page Load Action is not triggered again for Agent B.

    • Therefore our initialization logic is never executed for the new agent.

    We already have logic that could detect the agent change:

    lastAgentParticipantId != Scripter.Agent Participant ID

    If this logic runs, we can reset the URL push flags and execute the URL push once for the new agent while still preventing duplicate pushes after a script reload.

    What we are missing is the actual trigger.

    Is there a supported Scripter event or mechanism that can invoke a custom action when an existing interaction is assigned to a new agent after a transfer?

    For example, something equivalent to:

    • OnInteractionAssigned

    • OnTransfer

    • OnAgentParticipantChanged

    The important requirement is that we want to keep the originally assigned script and the existing conversation/script variables. We do not want to replace or reassign the script through Architect just to trigger the initialization again.

    Has anyone implemented something similar, or is there a supported Scripter mechanism for this scenario?

    Thanks in advance!


    #ArchitectandDesign
    #Omni-ChannelDesktop/UserInterface
    #System/PlatformAdministration
    #Other

    ------------------------------
    Yassin Alla
    ------------------------------


  • 2.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 8 days ago

    Hi Yassin, how are you?

    I'm not sure if I missed something on the whole scenario that would invalidate my suggestion, but can't you simply change the "Page Load" action that you mentioned at the beggining?

    Just add the logic that checks for "lastAgent != currentAgent" in there, and if the logic is returned as true you can reset all the flags, otherwise it just follows the current logic that is already in there.



    ------------------------------
    Marcello Jabur
    ------------------------------



  • 3.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 8 days ago
    Edited by Yassin Alla 8 days ago

    Hi Marcello, thanks for your reply!

    Yes, that was actually my first approach.

    I added the lastAgentParticipantId != Scripter.Agent Participant ID check directly at the beginning of the Page Load Action.

    The logic itself works correctly. I can also see that Scripter.Agent Participant ID changes from Agent A to Agent B after the transfer.

    The problem is that the Page Load Action is not executed again for Agent B.

    I verified this by adding a simple Scripter.Alert as the very first step of the Page Load Action:

    • Agent A receives the call → Alert is shown
    • Agent A transfers the interaction to another queue
    • Agent B receives the same interaction → no Alert is shown

    So after the transfer the script is still available and the built-in Agent Participant ID reflects Agent B, but the Page Load Action itself does not run again.

    That is basically the part I am trying to solve: I need some event/trigger on the receiving agent side that allows me to execute the lastAgent != currentAgent logic after the transfer, without replacing or reassigning the existing script.

    If there is another way to trigger a custom action when the interaction is assigned to Agent B, that would be exactly what I am looking for.

    Thanks!



    ------------------------------
    Yassin Alla
    ------------------------------



  • 4.  RE: Scripter – Trigger custom action after transfer to another agent
    Best Answer

    Posted 8 days ago
    Edited by Jason Kleitz 7 days ago

    Hi Yassin, that seems odd. I don't believe the "Page Load" action isn't supposed to be executed to the Agent B in your scenario.

    As the script is opening for the first time on his screen for this interaction (Thus, the "page loads").

    If this isn't happenning for you, it seems more like a bug.

    Have you tried to use this Alert in the page load action only by itself? (I mean, removing all other actions and conditions from the page load, and just making a very simple test with ONLY the alert?). Just to be absolutely sure that it isn't anything else causing the "page load" action to not be executed... As far as I recall, from 1~2 years ago when I tested some scenarios like that, I believe the "page load" action was executed normally to the receiving agent of a transfer.

    As for your other question, I don't think there is a different trigger that you could use to initiate those actions (unless you use the manual click of a button by the agent, but I'm assuming you don't want anything like that).

    -----------

    EDIT: Also, just to add here.. If you are testing this transfer between 2 agents both in a single computer (test agents), I would advise that you make sure they are using different browsers, or one is incognito mode, or anything like that. Just try to make sure they are as "separated" as possible, to not cause any conflicts in which Genesys Cloud believes the script has already loaded on the browser, and therefore it doesn't load it again for agent B.

    Make sure to also close all old interactions if you have any pending wrap-up codes on agent B or anything like that. Basically just try to simulate a real environment as best as possible, to avoid any conflicts during testing.

    Just saying all that because as far as I remember this transfer should not cause the "page load" action to fail on the receiving agent.



    ------------------------------
    Marcello Jabur
    ------------------------------



  • 5.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 5 days ago

    Hi everyone,

    thanks a lot for all the suggestions and feedback!

    I retested the scenario using separate browser sessions for Agent A and Agent B, and that was indeed the key point.

    With separate browsers, the Page Load Action is triggered correctly for Agent B after the transfer, and the initialization logic works as expected.

    So the issue was caused by testing both agents in the same browser/session.

    Thanks again to everyone who contributed and especially for pointing me in the right direction!

    Regards,  
    Yassin



    ------------------------------
    Yassin
    ------------------------------



  • 6.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 5 days ago

    Thanks for the update Yassin!

    Glad to know it worked!



    ------------------------------
    Marcello
    ------------------------------



  • 7.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 8 days ago

    Hi Yassin,

    Based on current Genesys Cloud scripting behavior, there is no supported Scripter event such as OnInteractionAssigned, OnTransfer, or OnAgentParticipantChanged that fires when an existing interaction is transferred to another agent while the same script instance is retained. The Page Load action only executes when the script/page is initially loaded, not when ownership of the conversation changes to a new agent.

    What you're observing is consistent with how Genesys Cloud handles transfers. During a transfer, the conversation remains the same and the agent participant is effectively replaced by a new participant. The script and its conversation variables can remain associated with the interaction, which is why Agent B sees the existing script state and variables. However, this participant change does not trigger a script reload or Page Load action.

    Therefore, if your logic depends on detecting that a different agent has received the interaction, you'll need some mechanism that executes repeatedly while the script is active rather than relying on Page Load. For example:

    if (lastAgentParticipantId != Scripter.Agent Participant ID)

    {

    // Agent changed

    // Reset URL push flags

    // Push URLs for the newly assigned agent

    // Update lastAgentParticipantId

    }

    The challenge is not the detection logic itself, but finding something that evaluates it. To my knowledge, Scripter does not provide a native event hook for participant replacement/agent reassignment.

    If this functionality is required, the typical options are:

    • Use a script mechanism that periodically evaluates state changes.
    • Trigger logic from some other script action that is guaranteed to execute after reassignment.
    • Re-architect the flow so that initialization is invoked externally rather than relying solely on Page Load.

    Unfortunately, I am not aware of any supported built-in Scripter event specifically for "agent changed after transfer." If anyone from Genesys can confirm otherwise, I'd be interested as well.

    Thanks,



    ------------------------------
    Francis Guo
    NA
    ------------------------------



  • 8.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 7 days ago

    Hi @Yassin Alla,

    I believe I had tested something similar earlier but never put it in production, can't recall if it was due to some similar issue.
    I would suggest you try this, unless you have already done so. Again, I believe this should work, though I have not tested it recently.


    - In the script, create the variables lastAgentParticipantId, URL1_Pushed, and other common variables as input/output variables (these are saved as participant values on the conversation)
    - In the destination queue, set the same script again as default script and/or create a simple in-queue flow for the destination queue and in that in-queue flow, add just 1 step of "Set Screenpop" and use the same script.
    - Once agent B received the call, it will fire the same script again but this time "It Should" trigger the initialization again defined in the script. You should then be able to get the participant data from Agent-A's call and re-do what you want.

    It would be interesting to know the outcome.

    Regards



    ------------------------------
    Vineet Kakroo
    Senior Technical Consultant
    ------------------------------



  • 9.  RE: Scripter – Trigger custom action after transfer to another agent

    Posted 6 days ago

    Hi @Vineet K.
    thanks a lot for the suggestion!

    The In-Queue Flow with Set Screen Pop using the same published script sounds like a good approach to test, especially since the relevant variables are already configured as input/output variables.

    I'll test the scenario:

    Agent A ->Transfer to Queue B -> In-Queue Flow / Set Screen Pop ->Agent B

    and verify whether this triggers the Page Load Action again for Agent B.

    Thanks again for the idea I'll report back with the result.

    Regards,
    Yassin



    ------------------------------
    Yassin Alla
    ------------------------------