The CreatorCon Call for Content is officially open! Get started here.

How to publish multiple software models to catalogs

MercBuilding
Tera Guru

Hi,

   We are publishing software models to catalog to make it available for end user to request, BUT its getting hard to open each model and publish it. Is there any way we can publish 50+ models at once?

 

Thanks!

10 REPLIES 10

Rafael Batistot
Kilo Patron

Hi @MercBuilding 

 

May you try via List View Update

 

  • Go to Software Models (cmdb_software_product_model table).
  • Switch to the List View.
  • Add the Published column if it’s not already visible.
  • Select the 50+ records you want.
  • Use List Edit (double-click cell or right-click → “Update Selected”) to mark Published = true in bulk.

 

https://www.servicenow.com/community/itsm-forum/i-need-to-create-a-new-list-view-for-my-list-the-who...

 

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

Hi @Rafael Batistot ,

   Appreciate your response but there is no such field on software models and i dont think we can publish from list view without any script.

ersureshbe
Giga Sage
Giga Sage

Hello,
Currently, there is no option available for enabling single shot transfer software models to catalogues. The rationale for publishing the catalogue from the model is through the UI Action - Reason; we will not consider the catalogues from the software model. This is necessary for the catalogues that technicians can convert as per business requirements.

 

If you wish to convert multiple models, you can refer to the 'UI action' - Publish to Software Catalog. Utilize that script, make any necessary adjustments, and execute it as a background script. I hope this meets your needs.

 

Best regards,
Suresh.

Regards,
Suresh.

Hi @ersureshbe ,

   Thanks for the reply so i have tried writing a fix script but its not working as expected giving some errors. PFB script.

 

publishSoftwareModel();

function publishSoftwareModel(){
var sc_category = 'pc_software_cat_item';  //the catalog category
var type = 'model';  
var catalog = 'software';

gs.info("testing");
var gr = new GlideRecord('cmdb_model');
gr.addEncodedQuery('product_catalog_item=NULL');
gr.setLimit(10);
gr.query();
while(gr.next()){
 
 
gr.product_catalog_item = (new ProductCatalogUtils()).createProductCatalog(gr,sc_category,type,catalog);
gr.update();
 
}
}