- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 09:21 AM
I have an application where there is a user, support and manager. When 1 ticket is created by the user, the default state is open and I change it to pending with flow
But how do I hide the open option? I still want to keep this option so I don't have to change the flow, but I want support to only be able to see the pending, worik in progress, closed complete and re-open options
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 11:04 AM
Hi @Arthur Sanchez ,
You can try something as below,
function onLoad() {
var checkRole = g_user.hasRole('x_1316384_tickets.tickets_manager');
// alert(checkRole);
if (checkRole == true){
g_form.removeOption('state','1'); // in place of '1' please add the backend value oof choice Open
}
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 10:31 AM
Hi @Arthur Sanchez ,
Please try below script
var userRole = g_user.hasRole('x_1316384_ticket.ticket_manager');
if (userRole){
g_form.removeOption('state', <backend value of open>);
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 10:37 AM
For some reason, it's not working, it doesn't remove/hide the option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 10:44 AM
Hi @Arthur Sanchez .
I tried this script in my PDI it's working fine for me. Can you check that testing user have this role x_1316384_tickets.tickets_manager if you are testing with your user you have to check like you have this role than only this option will hide for you
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2024 10:14 AM
Hi @Arthur Sanchez ,
You can use below script
g_form.removeOption('state', <backend value of state open>);
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak