How to show only incidents created by currently logged in user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 02:10 AM
Hi,
I am in a scenario to show only logged-in user-created incidents. I tried it, but it is not working. Kindly help.
if(current.sys_created_by == gs.getUserID()){
answer = true;
}
else{
false;
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 02:12 AM
Hi @Community Alums
Where you want to show these incidents?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 02:13 AM
Hi @Dr Atul - LNG,
When I am in the list view, I should see only the incidents created by the logged in user.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 02:15 AM
Hi @Community Alums
You can create filter and put created by dynamic Me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 02:20 AM
If you use ACL's for this, you are always only seeing your own incidents and none other. Next to that: use the conditions. 'opened by is dynamic me' can be used as a condition instead of scripting it.
Also: your script is handling 'sys_created_by' as a reference field to check if it's the current logged in user. That will never work, because sys_created_by is a string field.
If you just want to show someone a list of their own incidents, create a menu item 'my incidents' and set the condition to 'is dynamic me'. Your ACL will cause big issues with people having to watch or report on the incident table.