The FortiSOAR playbook data is rooted at vars.artifacts.data.results, and the Jinja template has the form {{ <object> | <filter><args>.<attr> }}. You pipe 'vars.artifacts' into the 'json_query' filter, whose JMESPath argument "data.results[?type=='FileHash-MD5']" selects only the entries whose type is FileHash-MD5, then append '.value' to output just the hash strings rather than the whole objects. 'tojson' merely serializes an object to a JSON string and would not extract the hash values, so it is a distractor here. The completed expression is {{ vars.artifacts | json_query("data.results[?type=='FileHash-MD5']").value }}, matching the automated key.
Community Discussion