Hi,
I need to retrieve some form fields in JSM request description
For this, I created an automation, which uses the API REST Forms
format/answers returns me the answers entered by the customer.
This works, but I can't create a loop on the number of responses, which forces me to hard-code multiple GET()
this is not very clean. Can you explain to me how to iterate on the results?
regards,
Hello @Bruno Altenhofen - could you help on this one?
I have the same question for a little different approach
I want to use the answer to create Asset Objects. Can we filter the fields by their fiedkey?
I know this is should be a different question, but this could be an Article inspirantion for you. Thanks for your articles so far :)
Hey @Patricia Francezi
Sure! :D
Unfortunately, we are limited here by the automation rule editor’s capabilities, which do not natively support loops or dynamic iteration over collections, such as arrays of responses. While we can sometimes use smart values and conditional logic to address this issue by verifying if a response exists before accessing it, this approach might not be suitable for scenarios where we need to retrieve responses separately. I've personally attempted various complex workarounds, including using regex with smart values, but I still receive a largely blank response from my web request... ç.ç
Therefore, it might be best for you and @Mélanie Liguet to manipulate the field values individually by utilizing the Forms properties.
I'll share a screen recording demonstrating how I use form responses to create an object in Assets:
Additionally, please be aware that Forms properties will be deprecated once the new Forms Smart-values are rolled out. Probably, with the introduction of Forms Smart-values, handling form values will likely become more efficient and streamlined for us... :B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What information is logged in the variable, are this multiple options?
If they are do an advanced branch in the rule based on the variable, then send the web request and edit action in the branch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing, I am not currently using JSM and so my suggestions are based on what I know about automation rules, in general. With that out of the way...
You seem to be using this endpoint for getting the answers in the simplified format: https://developer.atlassian.com/cloud/forms/rest/api-group-forms-on-issue/#api-issue-issueidorkey-form-formid-format-answers-get
That one seems to indicate looping over the body, but you show what appears to be lists of labels and answers separated within the body.
Is that what you see if you write the entire {{webhookResponse.body}} to the audit log?
Next, what are you trying to do with the information as you iterate over it?
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,
Yes i use this apir rest.I I call it to have only the customers' responses rather than the entire form.
I retrieve the question webhookResponse.body.label and the response webhookResponse.body.answer.
The goal is to allow the support team to be more responsive by directly displaying the information they need
the api does not allow to have the number of results returned
I don't use {{webhookResponse.body}} because it is not formatted and therefore not very readable and I have useless information for the team such as the id or the choice
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you try writing {{webhookResponse.body}} to the audit log when the rule runs, it may indicate how to iterate over the values, producing something more useful for the team.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wanted to follow-up to learn if you had tried other parsing options yet. Perhaps something like this:
{{#webhookResponse.body}}
* label: {{label}} with an answer: {{answer}}
{{/}}
Thanks!
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.