Hi ,
I have been working on an automation , as part of it I want to compare the value of a property in my JSON payload and store it.
I have sent a webrequest and it was successful , but {{webResponses.last.body}} returns an empty list [] . I could not find the reason as when I validated the webrequest I get the following payload
[ { "id": 12, "name": "ACI", "mappedProjectId": 0, "createNewVersion": true, "deploymentConfiguration": { "showBuildNumber": true, "showDescription": true, "preventDeploymentMerge": false, "readonlyDeployedIssues": false, "preventJiraDeploymentSync": false } }, { "id": 9, "name": "AEM", "mappedProjectId": 0, "createNewVersion": true, "deploymentConfiguration": { "showBuildNumber": true, "showDescription": true, "preventDeploymentMerge": false, "readonlyDeployedIssues": false, "preventJiraDeploymentSync": false } } ]
I want to compare the name with a issue field and store the respective id .
Could someone help or share your thoughts ?
Thanks in Advance !!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
What are you expecting the response to contain: a single response, or zero-to-many?
To confirm what the rule is receiving, I recommend writing these to the audit log (in separate Log actions) after the Send Web Request action to confirm the structure:
web responses size: {{webResponses.size|0}}
web response bodies: {{webResponses.body}}
web response body size: {{webResponse.body.size|0}}
web response body: {{webResponse.body}}
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.
Thanks for that information.
The syntax you are using to "find" the smart value in the webResponse body is invalid and not a feature of automation rules.
And, the supported way to filter within a list iterator would not work for your case because data / fields outside the iterator scope are not visible inside.
Once possible workaround is to use a dynamic list search, where the needed webResponse values are expanded into text, stored in a created variable, and then a dynamic regular expression is built to find what is needed (using your customfield_10255). If you want to try that approach, here is an article I wrote on the technique: https://community.atlassian.com/t5/Automation-articles/Automation-concepts-Dynamic-searches-within-a-list/ba-p/2834235
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.