Forum Discussion

Nilesh's avatar
Nilesh
Occasional Contributor
9 years ago

How to add fields from json response to Email body?

Hi,

 

I am using using json slurper to collect response from my Rest request,

but If any filed validation is failed I am using testRunner.gotoStepByName("Email step name Validation Error Email")

Which send an alert email to me.

But I have validating multiple fields hence In Email body I am able to add only text but want to make it dynamic i.e.

it should pick only the failed values + text message?

 

 

def getResponse = testRunner.testCase.getTestStepByName("RESTRequest").getPropertyValue("Response")

 

def ID= parse(Response).read('$.._Number__c')

 

i.e. if the validation on ID fails, I want to add #field + validation i.e length is not correct in message body for multiple elements.

No RepliesBe the first to reply