Making a draft item active is restricted

VirajM
Tera Contributor

Hi I am trying to progress through the ServiceNow CSA course module 5.2 create a catalog section. It seems that the Infinity HHD status is "not active" and it wont allow me to change it. 

 

Could I please get some help or assistance on this matter? Would be great to know where I went wrong or if I did something wrong.

1 ACCEPTED SOLUTION

AmrutaM
Mega Expert

I had the same issue, and I referred to this page from Community: https://www.servicenow.com/community/riseup-with-servicenow-forum/snow-administration-fundamentals-l...

There could be an issue with the instance. So, I tried a different solution. 
I tried creating a new catalog item on sc_cat_item table or All -> Service Catalog -> Catalog Definitions ->
Maintain Items (New) by copy pasting the same details from previously created catalog item. Then it allowed the new catalog item to be created in active status. 

Catalog item.png



 

View solution in original post

4 REPLIES 4

AmrutaM
Mega Expert

I had the same issue, and I referred to this page from Community: https://www.servicenow.com/community/riseup-with-servicenow-forum/snow-administration-fundamentals-l...

There could be an issue with the instance. So, I tried a different solution. 
I tried creating a new catalog item on sc_cat_item table or All -> Service Catalog -> Catalog Definitions ->
Maintain Items (New) by copy pasting the same details from previously created catalog item. Then it allowed the new catalog item to be created in active status. 

Catalog item.png



 

AnthonyG8785543
Tera Expert

This thing drove me crazy.  I tried the below solution but there was only one record.  There was never a secondary record to 'clear the log jam.'  Someone also mentions that the Instance may be the problem.  Confirmed by recreating this on my PDI.  PDI was fine, so it was the Lab Instance.

 

This STILL drove me crazy because as a CSA we will be expected to fix these kind of things.  I went into the Business Rules and saw how it's all read only, etc. (This is how I learn tech.  Gotta figure out how it works.)

 

Here's how I fixed it.  Modified code from someone moving around Email Business Rules:

 

NOTE: Run this in All > System Definition > Scripts - Background

var gr = new GlideRecord('sc_cat_item');
    gr.setWorkflow(false); // Prevents business rules from triggering during the update
    if (gr.get('<sys_id of your record that wont update>')) {
        gr.setValue('state', ''); // Removes the protection policy
        var success = gr.update(); // Save the changes and capture success
        if (success) {
            gs.info('Protection policy successfully updated for script: ' + gr.getValue('name'));
        } else {
            gs.error('Failed to update the protection policy for script: ' + gr.getValue('name'));
        }
    } else {
        gs.warn('No record found with the provided sys_id.');
    }

 

Run this then go back to your record and triumphantly ACTIVATE the record so you can proceed with the rest of your life!  Cheers!

Note: The script does not change any protection policies.  I did not change the comments from the code I borrowed.  Simply updates the state outside of the business rule.

Thank you so much!

As a hint: to get the sys_id just open the record (in this case Infinity HHD in Catalog Items and you can get the sys_id from the URL