How to create "Change Task" in a already created "Change Request" through Service Request "Workflow"?

anirban300
Kilo Guru

How to create "Change Task" in a already created "Change Request" through Service Request "Workflow"?

4 REPLIES 4

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Anirban,



Can you provide some additional details on what you are trying to accomplish?


We have created a change through Workflow(Run Script) of Service Request.Now we want to insert some Change tasks in the Change.


you can save the sys_id in a variable when you do the insert:           workflow.scratchpad.change_id = chage.insert();


then use that variable to create a record with a run script in the table change_task and fill the parent and/or change field with the sys_id of the change created.



That way you can assign task to your change.



Please mark correct or helpfull if this works!!


leahp
Kilo Guru

I have a workflow that will create a change request when a catalog task closes.  In addition to the change request, I need for it to open a change task, propagating specific information from the change request to the change task, specifically the fields listed below:

 

Configuration Item

Change Request #

Company

Short Description

 Assignment Group

Assigned To

 

Set due date to 5 days out. 

Below is script I have.  The only thing working is the due date.

 

task.change_request = current.getValue('sys_id');
task.cmdb_ci = current.getValue('cmdb_ci');
task.assignment_group = current.assignment_group;
task.assigned_to = current.getValue('assigned_to');
task.short_desccription = current.short_descrirption;
task.company = current.getValue('company');
task.u_category = 'Hardware';

 

thoughts?