From be46169a8902aedcd0fcedb45f75ecf0659d1be9 Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:29:21 +0530 Subject: [PATCH 1/2] Create ReadMe.md --- .../Add Loggedin user as Incident assigned to/ReadMe.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/ReadMe.md diff --git a/Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/ReadMe.md b/Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/ReadMe.md new file mode 100644 index 0000000000..d017057fbe --- /dev/null +++ b/Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/ReadMe.md @@ -0,0 +1,2 @@ +>**UI Action** +When a new Incident record is created, user can come to incident ticket and assigned to themself. Once they click on UI Action. From 8cedee8d85cf2fcc6a835d13c89acc8af4bc8d67 Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:29:49 +0530 Subject: [PATCH 2/2] Create code.js --- .../code.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/code.js diff --git a/Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/code.js b/Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/code.js new file mode 100644 index 0000000000..06b301c362 --- /dev/null +++ b/Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to/code.js @@ -0,0 +1,12 @@ +var currentUser = gs.getUserID(); //Getting loggedIn User Id + +//Checing wheather user is available or not in Assignee field +if(current.assigned_to == ""){ //checking assigned to is there or not + current.assigned_to = currentUser; //Setting the current loggedIn user + current.update(); //updating the record. + gs.addInfoMessage("Incident has been assigned to You."); + action.setRedirectURL(current); +} else { + gs.addErrorMessage("Incident is already assigned"); + action.setRedirectURL(current); +}