Put condition on Business rule and client script for incident state changes to change it onhold.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2025 05:00 AM
Hi everyone,
We have to create a BR and client script for the requirement if user with no itil role nor the member of assignment group will change the state to onhold then they will get error message and abort the action. We need this on change of state and from list view also.
I tried to put entire condition on condition field but it didn't worked. Please find below:
1. current.state.changes() && current.state == 3 && current.assignment_group != null && !gs.getUser().isMemberOf(current.assignment_group.toString()) || !gs.getUser().hasRole('itil')
2. Write a bore BR with the below condition and script
3. We have client script:
onchange client script:
None of the approach is working for now.
Thanks if you can hel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2025 05:15 AM
in the BR condition try this and then add logs and see where it's failing
current.state.changes() && current.state.toString() == '3'
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2025 05:24 AM
getting gs.getUserID() as blank or undefined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2025 05:29 AM
Is the script include Client callable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2025 06:02 AM
yes