- 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
02-05-2024 02:27 AM
yes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:37 AM
Hi @Poorva Bhawsar then try running your script using background script and put logs, and see if there are any errors
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 09:41 PM
I have added the logs. Its going inside the loop.
But then also its not updating that field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:04 AM
I got the solution. Thanks for your help. I need to use the server table instead of cmdb_ci table.
And it worked perfectly fine.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:13 AM
Hi @Poorva Bhawsar Nice..!
Harish