need to get HR case number created using Record Insert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Using ATF, I have created an HR case in sn_hr_core_case table using Record Insert step .
I need the HR case number & Created date to validate in further steps.
I have also tried Record Query, which gives me only the sys ID of the HR case record created. I need HR case number & created date. Can anyone help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The test step is still failing. It is showing "Something went wrong."
FYI. SysId from Record insert is working properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @PraveenaD ,
After the record insert step, use Run server side script test step. Use the below script in that step.
The Output of this Run server side script will be the HR case Number.
(function(outputs, steps, params, stepResult, assertEqual) {
var HrCaseSysid = steps('Syid of the Record insert step').record_id;
var hrGr = new GlideRecord('sn_hr_core_case');
hrGr.get(id);
outputs.record_id = hrGr.number;
})(outputs, steps, params, stepResult, assertEqual);
NOTE: Update the actual sysid of the HR Case Record insert step at line 2 of the above code.
The same u can do for Created.
If my answer helped, please mark it as helpful or accept as the solution.
Regards,
Chidanand