DumpJSON
Dumps a json from context key input, and returns a json object string result.
- Type
- python
- Pack
- CommonScripts
Source
import json
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
key = demisto.args()["key"]
obj_str = json.dumps(demisto.get(demisto.context(), key))
demisto.setContext("JsonStr", obj_str)
return_results(obj_str)
if __name__ in ("__main__", "__builtin__", "builtins"):
main()
README
Dumps a JSON from the context key input, and returns a JSON object string result.
Script Data
| Name |
Description |
| Script Type |
python3 |
| Tags |
Utility |
Inputs
| Argument Name |
Description |
| key |
The context path to the JSON object. |
Outputs
| Path |
Description |
Type |
| JsonStr |
The JSON object as a string. |
Unknown |