Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Hector Arreola
    How can I retreive the Primary Contact of a ticket with...
    Topic posted October 15, 2019 by Hector ArreolaRed Ribbon: 250+ Points, last edited October 15, 2019, tagged Connect PHP 
    23 Views, 1 Comment
    Title:
    How can I retreive the Primary Contact of a ticket with Connect PHP?
    Summary:
    How can I retreive the Primary Contact of a ticket with Connect PHP?
    Content:

    Hi community,

    I am trying to retreive the contact from the sample ticket on my process designer script, but I get the error "trying to get property of non-object" for most attempts, for others it just doesnt print anything (and I believe the contact is required while creating the ticket so it could not be null, right?.

    Thanks for helping!!

    EDIT

    Solution:

    $contact = $inc->PrimaryContact->LookupName;

    Comments Are Closed

     

    • Sebastiaan Draaisma

      I always use ROQL in my CPM
      Query can be tested on
      https://<YOURSITE>.custhelp.com/ci/admin/explorer/
       

      $ROQL = RNCPHP\ROQL::query("SELECT Incident.PrimaryContact.ParentContact.ID FROM Incident WHERE Incident.ID =".$obj->ID)->next()->next();
      $c_id = $ROQL['ID']; // Store the ROQL retrieved contact id into a variable