current.request_item does not return value

jyan3
Kilo Guru

Hi I'm trying to insert the RITM reference to a table in a workflow script, but when I use current.request_item, it doesn't seem to return anything. I've also tried to write it to a string column to see if it was an issue with the reference, but that doesn't write to the column either. Am I using the variable incorrectly?

 

Write code:

var options = ((current.variables.asset).toString()).split(',');
for (i = 0; i < options.length; i++) {
var acc = new GlideRecord("u_coi_privileged_access");
acc.initialize();
acc.u_request_number= current.request_item;
acc.u_start_date = current.variables.start_date;
acc.u_end_date = current.variables.end_date;
acc.u_hardware = options[i];
acc.u_user = current.variables.requested_for;
acc.insert();
}

 

 

table structure

jyan3_0-1667955020762.png

 

results

jyan3_1-1667955093164.png

 

1 ACCEPTED SOLUTION

jyan3
Kilo Guru

used current.sys_id

View solution in original post

1 REPLY 1

jyan3
Kilo Guru

used current.sys_id