We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

need to get HR case number created using Record Insert

PraveenaD
Mega Contributor

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?

 

6 REPLIES 6

The test step is still failing. It is showing "Something went wrong."

FYI. SysId from Record insert is working properly. 

Chidanand_VK
Mega Guru

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