Interaction - Scoped

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 5분
  • The Interaction API provides methods that enable you to define the behavior for interaction records.

    This class requires the Interaction Logging, Routing, and Queueing plugin (com.glide.interaction) and runs in the sn_interaction namespace.

    Interaction - accept()

    Accepts a new interaction.

    Accepting a transfer only works for pending transfers. Find any pending transfers in the Interaction Agent Transfer [interaction_agent_transfer] table.

    표 1. Parameters
    Name Type Description
    None
    표 2. Returns
    Type Description
    Boolean Returns true if the transfer is accepted.
    var now_GR = new GlideRecord('interaction');
    GR.get('b2c0a3af202a1300964f959e0488de75');
    var interaction = sn_interaction.Interaction.getInteraction(GR).accept();

    Interaction - create(Object options)

    Creates an interaction.

    표 3. Parameters
    Name Type Description
    options Object Field values for an interaction record. The channel field with the channel sys_id and channel metadata are required.

    If a queue is not included in the parameter, the system returns Interaction b2c0a3af202a1300964f959e0488de75 has no queue specified... running queue matching rules.

    표 4. Returns
    Type Description
    Object Interaction
    var interactionObj = sn_interaction.Interaction.create({
    	channel: '28a59893873103002ae97e2526cb0b5d',
    	channel_metadata:{},
    	opened_for: '46d44a23a9fe19810012d100cca80666',
    	queue: 'f3a50867b30303002186a72256a8dcb7'
    });

    Interaction - getInteraction(GlideRecord interaction)

    Returns an interaction record.

    표 5. Parameters
    Name Type Description
    interaction GlideRecord Interaction record from the interaction table [interaction] that is retrieved from the system.
    표 6. Returns
    Type Description
    Object Interaction
    var now_GR = new GlideRecord('interaction');
    now_GR.get('608a21bd096a9300964ffbd57ba7dd8d');
    var interaction = sn_interaction.Interaction.getInteraction(now_GR);

    Interaction - transferToAgent(String sysID)

    Transfers an interaction record to an agent using the sys_id for the agent.

    When an interaction is transferred from one agent to another, the interaction needs to be accepted or rejected using GlideRecord APIs. Use the GlideRecord API to change the state of the interaction and update. For more information, see the GlideRecord - update method.

    주:
    This method has been deprecated.
    표 7. Parameters
    Name Type Description
    SysID String The sys_id of the user you want to transfer an interaction record to.
    표 8. Returns
    Type Description
    void
    var now_GR = new GlideRecord('interaction');
    GR.get('24b927ef202a1300964f959e0488de2d');
    var interaction = sn_interaction.Interaction.getInteraction(GR);
    interaction.transferToAgent('6816f79cc0a8016401c5a33be04be441');

    Interaction - transferToQueue(String sysID)

    Transfers an interaction record to an interaction queue.

    Transferring an interaction from one queue to another closes the original interaction and creates an interaction in the new queue.

    주:
    This method has been deprecated.
    표 9. Parameters
    Name Type Description
    SysID String The sys_id of the interaction queue you want to transfer the interaction record to.
    표 10. Returns
    Type Description
    void
    var now_GR = new GlideRecord('interaction');
    GR.get('24b927ef202a1300964f959e0488de2d');
    var interaction = sn_interaction.Interaction.getInteraction(GR);
    interaction.transferToQueue('86fee1933b101300088d832b44efc474');