import groovy.json.JsonSlurper
try {
def command = ["curl", "-u", "C1111A:Password", "-X", "POST", "-H", "Content-Type: text/plain", "-k", "
https://abc.xyz.local/artifactory/api/search/aql", "-d", "items.find({\"path\":\"$env.tools\"})"].execute().text
artifact = new JsonSlurper().parseText(command)
//def jsonList = new JsonSlurper().parseText(command)
List<String> version = new ArrayList<String>()
for (i = 0; i <artifact.results.name.size(); i++)
{
version.add("'"+artifact['results'][i]['name']+"'")
}
return version
}
catch (Exception e) {
print "Problem fetching the version"
}
regards