I am trying to search user by e-mail address. I am using:
def userResult = get("/rest/api/2/user/search?username=hello@gmail.com")
.header('Content-Type', 'application/json')
.asObject(Map)
if (userResult.status == 200) {
return userResult.body.fields
}
else {
return "result.status"
}I get this response:
"Cannot get property 'fields' on null object"
I tried with each user, email and username and nothing changes.
Thank you for your help