So I'm trying to create a complex rule (if you're wondering, is related to Grafana),
1. first call an endpoint to get a very large JSON response (more than 4k lines)
2. use that JSON to call another endpoint....
that's it! it's simple in reality, but the problem is when using that json response as the custom data for the second request...
1. in that json response, I need to update a single line
2. Jira inputs it as "string" instead of a json object
I get this error in the Audit log
Send web request
Error response HTTP body:
Error publishing web request. Response HTTP status:
400
I tried these, according to the documentation, but they didn't work.... they print a blank string instead of parsing the json object
webhookResponse.body.dashboard.annotations.asJsonObject("annotations")
{{webhookResponse.body.dashboard.annotations.asJsonObject("annotations")}}
------
webhookResponse.body.dashboard.annotations.asJsonObjectArray("annotations")
{{webhookResponse.body.dashboard.annotations.asJsonObjectArray("annotations")}}
this is the expected result from above snippet
"annotations": {
"list": [
{
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "#5794F2",
"limit": 100,
"matchAny": true,
"name": "releases",
"showIn": 0,
"tags": [
"release"
],
"type": "tags"
},
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"limit": 100,
"name": "Annotations & Alerts",
"showIn": 0,
"type": "dashboard"
}
]
}