- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2019 11:15 PM
And also out of 10 records 5 records caller id should be one user and the other 5 records should be another user.
As I am new to service now please let me know to code it
Thanks in advnace!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 12:10 AM
Hi Shankar,
I have used the following script and the records are created.
for(var i = 0 ; i < 5 ; i++)
{
var gr = new GlideRecord('incident');
gr.initialize();
gr.caller_id = '62826bf03710200044e0bfc8bcbe5df1';
gr.insert();
}
for(var i = 0 ; i < 5 ; i++)
{
var gr = new GlideRecord('incident');
gr.initialize();
gr.caller_id = 'a8f98bb0eb32010045e1a5115206fe3a';
gr.insert();
}
If the above code doesn't work for you, check for ACLs that might prevent you writing on the field. I ran the above code and records got created. See the attachment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 12:18 AM
Have you changed the sys_ids to users in your environment?
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 12:10 AM
Hi Shankar,
I have used the following script and the records are created.
for(var i = 0 ; i < 5 ; i++)
{
var gr = new GlideRecord('incident');
gr.initialize();
gr.caller_id = '62826bf03710200044e0bfc8bcbe5df1';
gr.insert();
}
for(var i = 0 ; i < 5 ; i++)
{
var gr = new GlideRecord('incident');
gr.initialize();
gr.caller_id = 'a8f98bb0eb32010045e1a5115206fe3a';
gr.insert();
}
If the above code doesn't work for you, check for ACLs that might prevent you writing on the field. I ran the above code and records got created. See the attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 12:19 AM
yeah both are working fine as I have tried with catrgory as software its working but this caller id is showing empty
and there is no acl for that field as I can edit it on cell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 12:25 AM
yeah Buddies its working now ,i dont know wat I have done is weather right or wrong just instead of sys_id I have given the username
its showing the caller with that name and if i click on that user name uts taking to user form.Any way thnak you everyone!