How do I get Incident Tasks created via Workflow to attach to an incident.

cmoffett
Tera Contributor

I am creating Icident tasks in a workflow, that is fired via condition in an incident where the short description is specific.  This works when that type of incident is created and the work flow fires properly but when the incident tasks are created they are not attached to any incident I would like them attached to the Incident that fired the WorkFlow.    

 

We are on Istanbul patch 10a  

Please Help?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

In your Create Task activity, be sure to set task.parent_incident = current.sys_id, and to be double safe, set task.parent = current.sys_id as well.



That will "connect" the child incident task to the parent incident.


View solution in original post

4 REPLIES 4

Chuck Tomasi
Tera Patron

In your Create Task activity, be sure to set task.parent_incident = current.sys_id, and to be double safe, set task.parent = current.sys_id as well.



That will "connect" the child incident task to the parent incident.


This did not work for me. I put task.parent_incident = current.sys_id and task.parent = current.sys_id in the incident (create task). Since that didn't work I then put it in the incident tasks and it still didn't work. Do you have any other ideas? Thanks! Lydia

cmoffett
Tera Contributor

Lydia, at the beginning of the workflow I am using a run script with the below scratchpad scripting 

 

workflow.scratchpad.incident = current.sys_id;

 

Then in the Create Task workflow Item I have the following scripting. 

 

task.incident = workflow.scratchpad.incident;
task.parent = workflow.scratchpad.incident;

 

It's been awhile since i've written this so I'm not sure why I did it this way or if I had issues with it but this is what is working for me. 

 

 

 

Hello cmoffet, 'Finally' after going through many pages and failing, I finally got a task to be created.  I am a ServiceNow beginner and will be serving as an administrator.  Yet, to take any courses -- but, looking forward to doing so.

Our organization is moving toward the ServiceNow platform. 

Getting an incident task to be created was just an 'exercise' to see what a workflow can do.  I see many possibilities.  I felt a bit discouraged not getting a simple Workflow to create a task. Now, there it is. 

 

Thanks Very Much!!

    John