- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 01:13 AM
Sure, you can modify the script to filter the incidents assigned to the current logged in user. Here is the updated script: javascript var gr = new GlideRecord('incident'); gr.addQuery('assigned_to', gs.getUserID()); // filter incidents assigned to the current user gr.orderByDesc('sys_created_on'); gr.setLimit(5); gr.query(); while(gr.next()) { gs.print('incident number: ' + gr.number); } Here are the changes summarized: - Added a new line gr.addQuery('assigned_to', gs.getUserID()); to filter incidents assigned to the current user. - gs.getUserID() is used to get the sys_id of the current logged in user. - This line should be added before gr.orderByDesc('sys_created_on'); to ensure the filter is applied before sorting and limiting the results.