Manually formatting WebResponse to JSON in Automation

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

When using the {{webResponse.body}} Smart Value from a web request in an Automation rule, Jira does not return it in JSON format - although the WebResponse value is in JSON when using the browser or a different tool.


To get the value in JSON, you can manually format it as shown below.

How To Replicate

For this scenario, we are using Jira REST API to get the values. This may vary depending on how your application is configured.

  1. Create an automation rule that sends a web request
  2. Include the response body in a comment action

     
  3. Observe that it's not in JSON format


Workaround

To work around it, you will need to manually format it including the smart value for each field returned:



When this is done, the response body will be added in the correct JSON format.


(lightbulb)TIP: When working with web requests, you can also see some information regarding how to use the web response data here:

Relevant pages:


Last modified on Mar 4, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.