Do you think this will not work?
def lookupTickets() {
def zenDeskUserId
User currentUser = webAuthService.currentUser()
def http = new HTTPBuilder(zdURL)
http.auth.basic("${zdUser}/token", zdApiKey)
http.get(path: "/api/v2/users/search.json",
query: [query: currentUser.emailAddress],
requestContentType: ContentType.JSON, { resp, json ->
println "Response status: ${resp.statusLine}"
zenDeskUserId = json?.users[0]?.id
})
return zenDeskUserId
}