prashobkt thank you very much for your input. i was able to get this to work by using below code but now after i was able to get test case to rerun i am facing another issue to set status to Finished instead of Failed.
the rerun is passing but test case still showing failed in result. i am using testCaseResult.setStatus but it doesnt seem to work so far
for ( testCaseResult in runner.results ) {
testCaseName = testCaseResult.getTestCase().name
log.info testCaseName
if ( testCaseResult.getStatus().toString() == 'FAILED' )
{
log.info "$testCaseName has failed"
for (i = 0; i <3; i++) {
testCaseResult.testCase.run(null, false)
}
}
}