Skip to content

Commit 74d4c48

Browse files
authored
Code.js
1 parent b6d88ea commit 74d4c48

File tree

1 file changed

+12
-0
lines changed
  • Client-Side Components/UI Actions/Add Loggedin user as Incident assigned to

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var currentUser = gs.getUserID(); //Getting loggedIn User Id
2+
3+
//Checing wheather user is available or not in Assignee field
4+
if(current.assigned_to == ""){
5+
current.assigned_to = currentUser; //Setting the current loggedIn user
6+
current.update(); //updating the record.
7+
gs.addInfoMessage("Incident has been assigned to You.");
8+
action.setRedirectURL(current);
9+
} else {
10+
gs.addErrorMessage("Incident is already assigned");
11+
action.setRedirectURL(current);
12+
}

0 commit comments

Comments
 (0)