Use Javascript to dynamically set Assigned To field same as Opened By field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018 01:34 PM
Hi All, I can't seem to find exactly what I'm looking for, or am not thinking about putting the correct things together to get this working.
When a few team members and I want to send an incident back to the originating technician, we typically use templates for the work note and state. However, we manually copy the technician's name from the Opened By field into the Assigned to Field.
It would be beneficial and save some time when re-assigning incidents.
I know we can use something similar to below to get the CURRENT user's ID:
javascript:gs.getUserID()
I tried to string some things together to figure out the best way to assign to the opening tech by creating a template with the criteria of Assigned to is :
javascript:
var opener = [];
var inc = new GlideRecord('incident');
inc.get('opener','Opened By');
opener.push(inc.getValue('Opened By'));
Sadly, the above only shows that I attempted to modify the Assigned to field, but nothing actually shows up.
What would your suggestions for this be?
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018 02:16 PM
looks like you need server side code. Find solution here
https://community.servicenow.com/community?id=community_question&sys_id=b18dc32ddb9cdbc01dcaf3231f961984

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018 03:10 PM
Try this
javascript: gs.getUser().getUserByID(current.getValue('opened_by')).getID();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018 08:53 PM
I think you need to add "current".
try javascript:current.getValue('opened_by');