The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How I can create Work Order Task template via script?

Sagar24
Tera Contributor
My requirement is to create WO and WOT Template via Script. I was able to achieve till WO template but cannot be able to figure out how to create WOT template along with it in "cmdb_workorder_product_model" table. var gr = new GlideRecord('cmdb_workorder_product_model'); gr.initialize(); gr.name = "TESTING Semi annual"; gr.short_description = "Semi Annual Preventive Maintenance"; gr.qualification_group = "781da52637232000158bbfc8bcbe5db8"; gr.insert();
3 REPLIES 3

Ryan S
Kilo Sage

Did you ever find a solution to this?

AngelB
Tera Contributor

The WOT templates aren't in the same table as the WO templates, the table for WOT templates is 'cmdb_worktask_product_model' the only thing that i don't know how to do is how to make the relationship between a WO template to multiple WOT templates, but you can try with this at first step.

I was able to get the details I needed. The wo order template to WOT template mapping is done on this table:  sm_m2m_somodel_stmodel