# ScriptRunner Cloud JSON parsing and formatting

**URL:** <https://forum.library.adaptavist.com/t/scriptrunner-cloud-json-parsing-and-formatting/414>\
**Category:** ScriptRunner\
**Tags:** cloud, script-console\
**Created:** [December 15, 2023, 8:54am UTC](https://forum.library.adaptavist.com/t/scriptrunner-cloud-json-parsing-and-formatting/414 "2023-12-15T08:54:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcwong](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kcwong](https://forum.library.adaptavist.com/u/kcwong)\
**Post date:** [December 15, 2023, 8:54am UTC](https://forum.library.adaptavist.com/t/scriptrunner-cloud-json-parsing-and-formatting/414/1 "2023-12-15T08:54:52Z")

</div>

Since import statement is not working in Cloud ScriptRunner, how do I do JSON parsing and construction?

Unirest has some JSON-related classes like JsonNode (you can parse valid JSON with this one), but other classes like JSONObject and JSONArray, you can only get one from a method call but not instantiate one.

![image](https://us1.discourse-cdn.com/flex019/uploads/adaptavistlibrary/original/1X/fd3fac83bdc67fb186fb559a1e538fdfbea501e4.png)

If I want to programmatically construct a JSON body to send to Unirest’s .body() method, how do I go about that?
