I have created a
def value = messageExchange.responseHeaders["#status#"]
This is going to be very useful for future use. I did some searching and found a post regarding this at the SoapUI forum.
I tested it with an HTTP step (sorry, I don't have any rest services to use) and it works well. Luckily, SoapUI handles most all requests the same way so it should work for you as well.
And the raw code:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def httpResponseHeaders = context.testCase.testSteps["testName"].testRequest.response.responseHeaders def httpStatus = httpResponseHeaders["#status#"] def httpStatusCode = (httpStatus =~ "[1-5]\\d\\d") log.info("HTTP status code: " + httpStatusCode)