Need to use previous step value or display name as parameter in Run server side script ATF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 11:19 PM
Hi Team,
I need to use previous steps Incident no as parameter to the Run server side script Step in ATF.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 11:28 PM - edited 12-27-2022 11:29 PM
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**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 01:29 AM - edited 12-28-2022 01:49 AM
I am trying to get Incident Id from Record Query step and use that as parameter in Run server side script function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 03:33 AM
@Mohammed Rafi S Could you please share your test steps? and use case so that I can help you with steps.
Thanks,
Hemant