Freshdesk - Return the id of the call record just created.

Status
Not open for further replies.

greychain

Gold Partner
Advanced Certified
Joined
Jul 13, 2018
Messages
779
Reaction score
122
In the Freshdesk CRM how can I return the id of the latest record created after the ReportCall function has been called?
 
If you need to run a scenario after the ReportCall, you need to add your variables paths and the Outputs, and add the Next attribute. The next scenario will have access to all variables set by the previous scenario.
 
  • Like
Reactions: edossantos
ReportCall doesn't seem to return any results, although they are shown in the systemlog, what I need to get is the id.ReportCall is a post operation


'{"cc_emails":[],"fwd_emails":[],"reply_cc_emails":[],"ticket_cc_emails":[],"fr_escalated":false,"spam":false,"email_config_id":null,"group_id":null,"priority":1,"requester_id":51010663074,"responder_id":null,"source":3,"company_id":null,"status":2,"subject":"New Ticket01","support_email":null,"to_emails":null,"product_id":null,"id":87,"type":"Question","due_by":"2021-06-25T19:21:51Z","fr_due_by":"2021-06-23T19:21:51Z","is_escalated":false,"description":"<div>6/23/2021 2:21 AM: Answered incoming call from 0968697811 Barry O to 0004 (00:15)</div>","description_text":"6/23/2021 2:21 AM: Answered incoming call from 0968697811 Barry O to 0004 (00:15)","custom_fields":{},"created_at":"2021-06-22T19:21:51Z","updated_at":"2021-06-22T19:21:51Z","tags":["Inbound","Call","0004"],"attachments":[]}'
 
ReportCall doesn't seem to return any results, although they are shown in the systemlog, what I need to get is the id.ReportCall is a post operation


'{"cc_emails":[],"fwd_emails":[],"reply_cc_emails":[],"ticket_cc_emails":[],"fr_escalated":false,"spam":false,"email_config_id":null,"group_id":null,"priority":1,"requester_id":51010663074,"responder_id":null,"source":3,"company_id":null,"status":2,"subject":"New Ticket01","support_email":null,"to_emails":null,"product_id":null,"id":87,"type":"Question","due_by":"2021-06-25T19:21:51Z","fr_due_by":"2021-06-23T19:21:51Z","is_escalated":false,"description":"<div>6/23/2021 2:21 AM: Answered incoming call from 0968697811 Barry O to 0004 (00:15)</div>","description_text":"6/23/2021 2:21 AM: Answered incoming call from 0968697811 Barry O to 0004 (00:15)","custom_fields":{},"created_at":"2021-06-22T19:21:51Z","updated_at":"2021-06-22T19:21:51Z","tags":["Inbound","Call","0004"],"attachments":[]}'
You would need something like:

XML:
<Rules>
    <Rule Type="Any">id</Rule>
</Rules>
<Variables>
    <Variable Name="CallId" Path="id">
        <Filter />
    </Variable>
</Variables>
<Outputs AllowEmpty="false" Next="MyPostScenario">
    <Output Type="CallId" Passes="0" Value="[CallId]" />
</Outputs>

In your ReportCall scenario.
 
  • Like
Reactions: edossantos
You can use the ID you can obtain as @Frederick Marcoux has mentioned in a subsequent scenario. This will not be passed on to 3CX, because 3CX is not expecting anything back from the Call Journaling scenario.
 
  • Like
Reactions: Evolute IT
Thanks @Frederick Marcoux . I needed to manually add the Output section into the XML file. I had also forgotten to put the [] around the variable. Now I have the record to update, the agent and number I can retrieve the call recording location and put it into the correct Freshdesk record.

<Rules>
<Rule Type="Any">id</Rule>
</Rules>
<Variables>
<Variable Name="recordid" Path="id">
<Filter />
</Variable>
</Variables>
<Outputs Next="SaveRecording" AllowEmpty="false">
<Output Type="recordid" Passes="0" Value="[recordid]" />
</Outputs>
</Scenario>
 
Status
Not open for further replies.