- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 04:22 AM
@Ankur Bawiskar can you help me with below issue.
We need to close the long back created change tasks were state field is greyed out in draft state.already change request is in cancelled state. But still change task are in draft state. Tried background script to close those but still state is not getting changed. Can you please help me on this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 05:25 AM
your script is wrong
try this
var gr = new GlideRecord('change_task');
gr.addQuery('number', 'ctasknumber');
gr.query();
if (gr.next()) {
gr.state = 140;
gr.setWorkflow(false);
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 04:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 04:36 AM
No error atul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 04:52 AM
Hi @mohanmerava
I believe there’s a property causing this issue. Take a look at the Change → Cancel Change property. Try disabling it and see if that resolves the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 04:45 AM
you didn't share complete script. Please share the complete one
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 04:55 AM
Below code is used Ankur
var gr = new GlideRecord('change_task');
gr.addQuery('number', 'ctasknumber');
gr.query();
gr.state= 140;
gr.update();
