- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 07:48 AM
The requirement is to change the state of the problem record from 'closed" to "assess".
On writing the fix script, i see that the state is still in "closed" state .
How to fix the issue as my below code didn't work?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 07:59 AM
Hi @phr ,
try this
var gr = new GlideRecord("problem");
gr.addQuery("numberSTARTSWITHPRB0000055");
gr.query();
while (gr.next()) {
gs.info('record exist ' + gr.getValue('number'));
gr.state = 102; //As per the backend value of the state
gr.active = true;
gr.setUseEngines(false);
gr.setWorkflow(false);
gr.update();
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:16 AM
Hello @phr, Closed is considered a final state and state model takes care of not allowing to move it back. and we should avoid this. for testing purpose, you can include following line in your script and try
gr.setUseEngines(false);
Regards,
Nishant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:28 AM
Just a query .
My instance is on Yokohama..
Problem model is enabled.
Without using setUseEngines(false) I was able to move the state from closed to assess..
Any idea how it works?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:33 AM
My PDI:
Build name: Xanadu
Build date: 03-06-2025_0935
Build tag: glide-xanadu-07-02-2024__patch7-02-27-2025
and it needed the setUseEngines(false) 🤷🏻♀️
I also tried using SNUtils, double click on the field name and inserted "102"... it changed the state to RCA but the state bar in the top was showing Asses 😄
Very weird...
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:36 AM
Hi @J Siva ,
may be the problem record you have picked up
is having model value
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 08:54 AM
@phr yeah. It has prb_model value

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 07:59 AM
Hi @phr,
Probably the state model is preventing the transition of the state.
(https://instance_name.service-now.com/nav_to.do?uri=sys_state_model.do?sys_id=df73699a3b031300ad3cc9...)
You could temporarily disable it, in order to make the state change possible.
A better solution would be to simply create a new problem.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.