Hello all,
I use Jira automation for a long time but it is quite the first time I have to integrate an API call in my automation rule.
The context is the following: From a JSM ticket, I want two of the organization detail fields values to be copied to a custom field in an internal project ticket created automatically.
So, I was able to authentify, I was able to configure the API call, I got a 200 response with a correct payload.
My question is more about the dot notation. I'm used to XPath3 but I cannot transfer that knowledge to this strange syntax...
This is my payload:
{ "id": "24", "name": "MY CLIENT", "details": [ { "id": "104", "name": "Key client", "type": { "name": "SELECT", "options": [ "Yes", "No" ] }, "values": [ "Yes" ], "configuration": { "position": 0 } }, { "id": "105", "name": "Client at risk", "type": { "name": "SELECT", "options": [ "Yes", "No" ] }, "values": [ "No" ], "configuration": { "position": 1 } } ] } Quite easy, as I have two properties listed in details, so I can access the first one like
{{webResponses.last.body.details.first.values.first}}
and the other one with
{{webResponses.last.body.details.last.values.first}}
Ok that's cool, but how would I do it if I have more than two? Is there a way to enter specific node like in Xpath? Or at least an indexer? I don't know something like
{{webResponses.last.body.details[0].values[0]}}
Is there another way to parse the result?
Thanks for your help!