- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 08:41 AM
Hi everyone, Im trying to get the "assignment_group" and "assigned_to" from a "sc_req_item" record to a notification on the "sysapproval_approver", I have tried in some diferent ways, but nothing seems to work ...
I have tried to use:
${document_id.assigned_to}
${document_id.assignment_group}
------------------------------------------
${assigned_to}
$assignment_group}
------------------------------------------
And also with script:
var gr = new GlideRecord('sc_req_item');
gr.get(current.sys_id);
template.print('<b> Assigned To: <\b>' + gr.assigned_to + '\n'
+ '<b> Assignment Group: <\b>' + gr.assignment_group);
But havent been able to make it work, does anyone know how to do this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 09:09 AM
Hi @F_bio Santos ,
The sc_req_item record's sys_id is stored in the document_id field so to get the Assigned to and Assignment Group update the code as below:
var gr = new GlideRecord('sc_req_item');
gr.get(current.document_id);
template.print('<b> Assigned To: <\b>' + gr.getDisplayValue("assigned_to") + '\n'
+ '<b> Assignment Group: <\b>' + gr.getDisplayValue("assignment_group"));
Also to get the name of the assigned to and assignment group use getDisplayValue() method.
If this solution helps you then, mark it as accepted solution ✔️ and give thumbs up 👍!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 09:09 AM
Hi @F_bio Santos ,
The sc_req_item record's sys_id is stored in the document_id field so to get the Assigned to and Assignment Group update the code as below:
var gr = new GlideRecord('sc_req_item');
gr.get(current.document_id);
template.print('<b> Assigned To: <\b>' + gr.getDisplayValue("assigned_to") + '\n'
+ '<b> Assignment Group: <\b>' + gr.getDisplayValue("assignment_group"));
Also to get the name of the assigned to and assignment group use getDisplayValue() method.
If this solution helps you then, mark it as accepted solution ✔️ and give thumbs up 👍!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 11:07 AM
Hi @debendudas it worked but for some reason now I have the html elements on the notification "<>"