Catalog Item Stuck in a Checked Out State
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 08:02 AM
I have an item that was edited in Catalog Builder, then submitted. It's status immediately went to "Checked Out". After waiting a few hours, I looked again and it was still "Checked Out". I attempted to edit it and got the message you see below.
I went and looked at the Record Producer in Maintain Items and there it said it was in the process of being published. There was no button to "Cancel Checkout".
I waited another 12 hrs and nothing changed. It still said "Checked Out" in the Catalog Builder and "Publishing" in Maintain Items. I went to look at the Record Producers and saw 2 entries, on is the one publishing, the other says "Reviewed".
Neither will let me let me update them, change their status, or generally do anything. Any suggestions to resolve this? Thanks!
- 4,434 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 08:16 AM
What is the problem? There is no mention of "Restoring a deleted catalog item" either in the initial post or in my answer. Plus, there is no need to validate if the catalog item is marked as Checked out. May I ask if you intent is to start a new question or suggest a solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 10:59 AM - edited 08-11-2023 11:00 AM
My intent was suggest an update to your solution. The issue found was I had to modify the script and add one more field, State <state>, and set the value to published:
var cat = new GlideRecord('sc_cat_item');
cat.addQuery('sys_id=SYSID');
cat.autoSysFields(false); // This will avoid updating the system fields of the table used
cat.query();
if (cat.next()) {
cat.setValue('state', 'published'); // Set state to published
cat.setValue('checked_out', false); // Set checked_out state to false
cat.setWorkflow(false); // This will override any related Business Rules from stopping the updates
cat.update();
}
Once I ran this, it published the Record Producer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 09:59 AM
Fixed it on our end... tried everything from removing the audit (like one article recommended) editing the state in list view, etc. My fix was exporting the sc_cat_item in XML, modifying the checked_out, allow_edit, and state fields, then re-uploading.. hope it helps.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1166254
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 10:02 AM
For anyone looking for a solution, here's how I got it to work .. and I tried everything from removing the audit (like one support article recommended), editing the state in list view, reverting versions, etc. My fix was exporting the sc_cat_item in XML, modifying the checked_out, allow_edit, and state fields, then re-uploading.. Hope it helps.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1166254
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 09:45 PM
There is no need to export the XML. Just run a background script and make your changes.
If you're simply wanting to move the item back to Draft so it can be edited in catalog builder use:
var gr = new GlideRecord('sc_cat_item');
gr.get('SYSID'); // Where SYSID is the sysid of your cat item
gr.state = 'draft';
gr.update();
If the item is indeed checked out you can do the same as above for that field. If you run into any issues simply add a setWorkflow(false) in there too.
Things get a bit messy when you have a published item already, and then you're editing a draft of that item. You need to be weary of the published_ref.
All the best.