From Assertion:
def requestId = context.currentStep.testRequest.response.responseHeaders["RequestId"]
From Groovy Script:
def requestId = testRunner.testCase.getTestStepByName("GetPortfoliosList").httpRequest.response.responseHeaders["RequestId"]