- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 10:52 PM
Hi Community,
I have few select box variables, if user selects the value of those variables as rejected, rejection reason field will populate. I want to copy the value of those variables if they are rejected along with the rejection reason from sctask to another table's journal type field.
I am thinking about the logic like if xyz == rejected && rejection reason != '' then need to add them in that journal field. If those are not rejected, those i approved i dont want to add them in this journal field.
Thanks,
Poorva Bhawsar
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 12:13 AM
Hi @Poorva Bhawsar the error is below
var answer = [];
var server_name = current.variables.server_name_s.toString();
var arr = server_name.split(',');
for (var i = 0; i < arr.length; ++i) {
var grCI = new GlideRecord('cmdb_ci_server');
grCI.addEncodedQuery('sys_idIN' + server_name.toString());//replace to arr[i]
to
grCI.addEncodedQuery('sys_idIN' + arr[i]);
grCI.query();
while (grCI.next()) {
//gs.log("Inside the l
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 02:16 AM
Hi @Poorva Bhawsar no need to do multiple glide, you can just pass multiple variables like this
gr.comments += "Rejected Reason :"+current.variables.variablename +'<br>'+ "Reason": +current.fieldname +'<br>'+ "variableName:"+current.variables.variablename +'<br>'+;
gr.comments += variableName1:"+current.variables.variablename1 +'<br>'+;
gr.comments += variableName2:"+current.variables.variablename2 +'<br>'+;,
it will map all your variables to comments field. you can see the mapped values in activity of the record .
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 09:28 PM
But i have multiple variables and for those multiple variables i have multiple different variables for rejection reasons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 09:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 06:20 PM
Hi @Poorva Bhawsar Assuming you BR is after update on SC Task table, try below code
if (current.variables.vendor_support_in_place_approval == 'failed' && current.variables.rejection_reason3 != ''){
var gr = new GlideRecord('tablename'); //table you want to copy variable value
gr.addQuery('parent', current.sys_id); // parent field from your table holds sc task sysID
gr.query();
if(gr.next()){
gr.u_deviation_notes = "Requested Number: " + current.variables.number, "Rejected Reason :" + current.variables.rejection_reason3 +'<br>'+ "Failed :" + current.vendor_support_in_place_approval;
gr.update(); // missed update here, you need to update your custom table
}
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:24 PM
Do i need to glide record all conditions?