Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to use previous step value or display name as parameter in Run server side script ATF

Mohammed Rafi S
Tera Contributor

Hi Team,

 

I need to use previous steps Incident no as parameter to the Run server side script Step in ATF.

Thank you

3 REPLIES 3

Hemant Goldar
Mega Sage

Hi @Mohammed Rafi S ,

 

Please use below script to get incident number.

 

var request_Id = steps(sysIdforStep6).request_id;//sysIdforStep6=sys_id of step which creates a new incident.
var incident_number;
var incNo= new GlideRecord('incident');
incNo.addQuery('sys_id',request_Id);
incNo.query();
if(incNo.next()){
incident_number=incNo.number;
}

 

 

Hope this helps!

 

Regards,

Hemant 

**Please mark my answer correct or helpful based on the impact**

@Hemant Goldar 

I am trying to get Incident Id from Record Query step and use that as parameter in Run server side script function

 

 

@Mohammed Rafi S Could you please share your test steps? and use case so that I can help you with steps.

 

Thanks,

Hemant