Hey, Would you please try below code:-
import groovy.json.JsonSlurper
def json = '''[
{
"Type": "XXXX",
"Code": "XXXXX",
"ShortName": "ShortName",
"Name": "",
"Description": "",
"DocumentManagementStoreUrl": null,
"IsActive": true,
"EffectiveDate": "2013-12-10T00:00:00",
"TerminationDate": null,
"WasCreatedInError": false,
"DataTimeStamp": "2018-04-30T08:42:45Z"
},
{
"Type": "XXXX",
"Code": "XXXXX",
"ShortName": "ShortName",
"Name": "",
"Description": "",
"DocumentManagementStoreUrl": null,
"IsActive": true,
"EffectiveDate": "2013-12-10T00:00:00",
"TerminationDate": null,
"WasCreatedInError": false,
"DataTimeStamp": "2018-04-30T08:42:45Z"
}
]'''
def code = new JsonSlurper().parseText(json)
log.info code
you have used some unexpected character "/" because of which you might be getting errors. I have removed these characters from "Name" and "Description" key.
Here is how you will get the output of the above code:-
Mon Apr 30 18:35:23 IST 2018:INFO:[{Code=XXXXX, DataTimeStamp=2018-04-30T08:42:45Z, Description=, DocumentManagementStoreUrl=null, EffectiveDate=2013-12-10T00:00:00, IsActive=true, Name=, ShortName=ShortName, TerminationDate=null, Type=XXXX, WasCreatedInError=false}, {Code=XXXXX, DataTimeStamp=2018-04-30T08:42:45Z, Description=, DocumentManagementStoreUrl=null, EffectiveDate=2013-12-10T00:00:00, IsActive=true, Name=, ShortName=ShortName, TerminationDate=null, Type=XXXX, WasCreatedInError=false}]