From 4ae30876c9121174e0431c619be2a2b3dca48290 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Wed, 22 Oct 2025 20:24:06 +0530 Subject: [PATCH 1/4] Add script to display user mentions in records This script retrieves and displays the top 5 records where the user is mentioned, including links to those records. --- .../My Mentioned Items/server script.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Modern Development/Service Portal Widgets/My Mentioned Items/server script.js diff --git a/Modern Development/Service Portal Widgets/My Mentioned Items/server script.js b/Modern Development/Service Portal Widgets/My Mentioned Items/server script.js new file mode 100644 index 0000000000..6c4490547b --- /dev/null +++ b/Modern Development/Service Portal Widgets/My Mentioned Items/server script.js @@ -0,0 +1,21 @@ +(function() { + /* + This code will display the records wher user is mentioned in (@user in Jurnal fields). + This will also provide the link to record. + Only top 5 mentions will be displayed. + */ + data.mentionArr = []; // array to store mentions. + var mentionRec = new GlideRecord('live_notification'); + mentionRec.addEncodedQuery('user=' + gs.getUserID()); // get only logged-in user's records + mentionRec.orderBy('sys_created_on'); // get by created date. + mentionRec.setLimit(5); + mentionRec.query(); + while (mentionRec.next()) { + tempval = {}; // temp object. + tempval.record = mentionRec.getValue('title'); + tempval.user = mentionRec.user.name.toString(); + tempval.user_from = mentionRec.user_from.name.toString(); + tempval.url = '/' + $sp.getValue('url_suffix') + '?id=ticket&sys_id=' + mentionRec.getValue('document') + '&table=' + mentionRec.getValue('table'); + data.mentionArr.push(tempval); + } +})(); From 2bfc6ff6f300fd00468fbb5463c9e8885848862a Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Wed, 22 Oct 2025 20:24:57 +0530 Subject: [PATCH 2/4] Add CSS styles for My Mentioned Items widget --- .../My Mentioned Items/CSS.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Modern Development/Service Portal Widgets/My Mentioned Items/CSS.js diff --git a/Modern Development/Service Portal Widgets/My Mentioned Items/CSS.js b/Modern Development/Service Portal Widgets/My Mentioned Items/CSS.js new file mode 100644 index 0000000000..4f2b212d95 --- /dev/null +++ b/Modern Development/Service Portal Widgets/My Mentioned Items/CSS.js @@ -0,0 +1,15 @@ +/* +list css to show border-bottom and padding. +*/ +li{ + padding: 1.2rem 0; + border-bottom: .1rem solid #DADDE2; + list-style:none; +} + +/* +set background color of widget to white. +*/ +.main-cont{ + background:#ffffff; +} From 48d3eb5b3c33f216273cdb6dc79e070283d8ba4f Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Wed, 22 Oct 2025 20:25:23 +0530 Subject: [PATCH 3/4] Add HTML structure for My Mentioned Items widget --- .../My Mentioned Items/HTML.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Modern Development/Service Portal Widgets/My Mentioned Items/HTML.js diff --git a/Modern Development/Service Portal Widgets/My Mentioned Items/HTML.js b/Modern Development/Service Portal Widgets/My Mentioned Items/HTML.js new file mode 100644 index 0000000000..db385f096e --- /dev/null +++ b/Modern Development/Service Portal Widgets/My Mentioned Items/HTML.js @@ -0,0 +1,14 @@ +
+
+

${My Mentions}

+
+
+
+
    +
  • + ${You have been mentioned in }{{item.record}} ${by }{{item.user_from}} +
  • +
+
+
+
From 5610b7e22493bd624e8fcb4ec7bd59680a13fd81 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Wed, 22 Oct 2025 20:31:11 +0530 Subject: [PATCH 4/4] Add usage instructions and use case for widget Provides instructions on how to use the widget and its use cases. --- .../My Mentioned Items/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Modern Development/Service Portal Widgets/My Mentioned Items/README.md diff --git a/Modern Development/Service Portal Widgets/My Mentioned Items/README.md b/Modern Development/Service Portal Widgets/My Mentioned Items/README.md new file mode 100644 index 0000000000..753a233746 --- /dev/null +++ b/Modern Development/Service Portal Widgets/My Mentioned Items/README.md @@ -0,0 +1,12 @@ +**How to use** +1. Add this widget to portal homepage or any other page. +2. It will display the top 5 records where user is mentioned in. +3. It will also display the user who has mentioned the logged in user. + +**Use Case** +1. User will receive the mentioned items on portal homepage. +2. User can directly go to the record and reply. +3. The link will land the user on tickets page. + +my mentions +