- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 01:02 AM
Hi @all,
Here I am hiding the choice called "closed" on change task only when change request is in new state.
for this I had below on load client script on change task:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 01:12 AM
Hi,
A Change request in the state of "New" translates to the value "-5"
Please try and see if it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 01:12 AM
Hi,
A Change request in the state of "New" translates to the value "-5"
Please try and see if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 01:38 AM
thanks for pointing out it worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 01:37 AM
It should be available by default, so just remove it and don't add the choice
also New state means -5
try this
function onLoad() {
g_form.getReference('change_request', function(ref) {
if (ref) {
var parentState = ref.state;
if (parentState.toString() == '-5') {
g_form.removeOption('state', '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