Can anyone advise me on what the proper syntax is to be able to read a web request response string?
I am trying to build an automation rule using a send web request action (to establish the account IDs that need to be appended to a work item as participants), followed by simply writing the response string to either the audit trail or a variable/smart tag so I can evaluate it before actually applying the value to the participants field. However, none of the following syntaxes work:
{{webResponse}}
{{webhookResponse}}
{{webRequest.response.body}}
{{webRequest.response}}
{{response.body}}
Can anyone advise what the proper syntax is to obtain the response string from this web request? I did find some tangentially related posts elsewhere in the forum, but none have actually helped me resolve this issue yet.
Thanks in advance.
Hi @Tim Bonney
The proper smart value is: {{webResponse.body}}
Thank you Marc.
I think I have found that {{webhookResponse.body}} is functioning. Is this possibly an either/or scenario, where either one will actually work, or is is absolutely {{webResponse.body}}?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tim Bonney
This depends of you use a webhook trigger or web request action in automation
{{webhookResponse.body}} is for webhook trigger and {{webResponse.body}} for web request action
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent! Thank you for the clarification Marc! (I am using web request, so your initial answer still applies.) Thanks again for sharing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tim Bonney
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
I am glad to learn you are writing the entire {{webResponse.body}} to the audit log as that will help know the structure for the specific endpoint called.
{{webResponse.body}} is likely a list of values for what you describe, and could be iterated over for your participant updates.
Kind Regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill. Thanks for your response and feedback. I apologize for being too vague.
Since posting this, I believe I have determined that the proper syntax is actually webhookResponse.body...and in my particular use-case should be webhookResponse.body.participants. However, it appears to be failing due to security/login issues, not improper syntax as I initially suspected.
What I am doing is trying to append the participants on work items, based on a set schedule, with a 12 hour work day divided amongst 4 different analysts, assigning each as a participant on newly created work items depending on the time of day the work item is created.
Since I do not have the option to store a table or worksheet in JSM, I had to think outside the box and create a Google sheet to house the table and use a Google Apps Script to generate the proper account id for whomever the participant is that needs to be added.
What I have discovered though, is that the web request GET call is unable to get past the login page of the Google app/script because it is housed within our company network and therefore inaccessible to "all/anonymous" users such as JSM when executing the call from the automation rule to obtain the appropriate Account ID to use.
So now I need to figure out how to get over that hurdle instead of the proper syntax to read the call response, which is the one I initially thought I needed to get over.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.