Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

use web request response on a second web request

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:

[{"classification":"DeserializationError","message":"invalid character ',' looking for beginning of object key string"},{"fieldNames":["Dashboard"],"classification":"RequiredError","message":"Required"}]


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"

}

]

}

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

199 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you