Creating a Task from a cmdb_ci in Service Operations Workspace (SOW)

Martin Brochu
Tera Guru

Hello,

In a cmdb_ci record, I want the user to be able to create a task. I added a UI Action inspired by the existing "Create Incident" UI Action (now/nav/ui/classic/params/target/sys_ui_action.do%3Fsys_id%3D6071fa390b2322001604628393673ac9%26sysparm_record_target%3Dsys_ui_action%26sysparm_record_row%3D4%26sysparm_record_rows%3D2761%26sysparm_record_list%3DORDERBYDESCsys_updated_on)

Here is my script:

 

var url = new GlideURL("task.do");
url.set("sys_id" , "-1");
url.set("sysparm_query" , "cmdb_ci=" + current.sys_id);
action.setRedirectURL(url.toString()+"");

 

I was expecting that it would open a new tab with an empty Task (except cmdb_ci field prefilled) but it opens two tabs:
MartinBrochu_0-1718391025086.png

 

Here is the resulting url for the new tabs: 

now/sow/record/u_cmdb_ci_derogation_securite_information/f822b6b41bbe0610d24acaee034bcb46/params/selected-tab-index/0/sub/record/~~undefined~~/-1_uid_36/params/query/cmdb_ci%3Df822b6b41bbe0610d24acaee034bcb46/extra-params/query%2Fcmdb_ci%3Df822b6b41bbe0610d24acaee034bcb46

 

We can see that there's ~~undefined~~ in the url.

 

I tried replacing first line in the script with

 

var url = new GlideURL("sc_task.do");

 

and it opens a new catalog task as expected.

 

Anyone has an explanation why task.do does not work?

1 ACCEPTED SOLUTION

Rahul Singh7
Tera Guru

Hello Martin,


The Task table serves as the base class for essential ITSM applications like Incident, Problem, and Change Management. It does not have a ticket type of its own. Essentially, the Task table contains all tickets from its child tables. This means that tasks are not directly created on the task table but rather on its child tables.

Therefore, when creating a ticket via any UI action, you need to specify the table name, such as sc_task, incident, and so on, where you want the ticket to be created.

View solution in original post

1 REPLY 1

Rahul Singh7
Tera Guru

Hello Martin,


The Task table serves as the base class for essential ITSM applications like Incident, Problem, and Change Management. It does not have a ticket type of its own. Essentially, the Task table contains all tickets from its child tables. This means that tasks are not directly created on the task table but rather on its child tables.

Therefore, when creating a ticket via any UI action, you need to specify the table name, such as sc_task, incident, and so on, where you want the ticket to be created.