Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Marv Ferrer
    Connect PHP - Get ID of Current Incident/ObjectAnswered
    Topic posted July 21, 2016 by Marv FerrerSilver Trophy: 7,500+ Points 
    545 Views, 20 Comments
    Title:
    Connect PHP - Get ID of Current Incident/Object
    Content:

    I'm trying to grab some incident information and push them into an external form when an incident is saved/updated. And I'm trying to do so from the Process Designer.

    I can't seem to find in the documentation on how to get the ID of the incident/object that is currently being created/updated. 

    We need a more user-friendly developer documentation, in general! LOL

    Best Comment

    Anuj Behl

    If you don't find much in documentation, there's a blog post detailing how to write a first CPM which might help you.

    Comment

    • Anuj Behl

      Agreed. And after around 3 years of posting that issue, the excuse shouldn't be that CPM's a 'new' feature.

    • Marv Ferrer

      See attached. Is there a reason why the api event would show up several times in the audit log? LOL

      I edited the same incident and it added a whole lot more in the audit log. Eventually the incident takes longer and longer to load.

       

       

    • Anuj Behl

      I am not able to access the screenshot, but it sounds like your CPM is going into a loop. Could you confirm you are passing SuppressAll with connect save() method in your code.

    • Marv Ferrer

      I'm using $incident->save(RNCPHP\RNObject::SuppressAll);. I actually forgot to check "Can Suppress" option when assigning the object handler. I've been turning it on/off today. Looks like I'm good for now :)

       

    • Erica (Leep) Anderson

      Anuj Behl said:


      I am not able to access the screenshot, but it sounds like your CPM is going into a loop. Could you confirm you are passing SuppressAll with connect save() method in your code.




      I know this issue has been solved, but I wanted to add a quick note that the screenshot isn't opening, because 'api' is in the file name. This is a defect, but we're not sure if/when it will be fixed given the Community deprecation and low severity and frequency of this issue. 



      However, as a workaround, there is a way for you to still be able to access the file attachment.



      1. Right click on the link to the file attachment, and copy the URL to that link.



      2. Paste the URL into your browser but right before the occurrence of 'api' in the URL, type in any letter and then press enter.



      For example, in the first example you provided, we can see the URL is: http://communities.rightnow.com/files/7275aed8d6/api_in_audit_log_repeats.PNG



      If you just add in a letter before 'api' and navigate to http://communities.rightnow.com/files/7275aed8d6/aapi_in_audit_log_repeats.PNG this will workaround the issue.



       



      Thanks to Rajan Davis for bringing this issue to my attention!



       



      Best,

      Erica, Community Manager