How to Create a relationship between incident and incident task in the ServiceNow

Veera raju
Tera Expert

Hi,

How to Create a relationship between incident and incident task in  the ServiceNow.

Kindly help me with the step by step process for the same.

10 REPLIES 10

No,

I am asking that i have created a table name is Incident task1. i want to create a relationship between Incident and Incident task1. which i was created.

Please help me out on the same functionality.

Regards,

Why would you create a new incident task table when one is already existing?

But for your requirement, just create a reference field to incident table on your incident task1 table and your relationship will be there. Read more about how it works in the post from David Dubuis.

Hi 

THEN

create the 

Before insert BR on incident_task on table

and 

write script like

Note: your incident task table coloumn should be like incident reference field(incident) and incident task reference field(incident_task).

 

var gr=new GlideRecord('incident task1');

gr.initialize();

gr.incident=current.incident;

gr.incident_task=current.sys_id;

gr.insert();

//please check the name and syntax

this bR will create relation between incident and incident_task table here

LIKE:

Record:  incident            incident task

            INC0000005      TASK0020992

            INC0000005      TASK0020993

let me know if any doubt

Thanks

 

 

This business rule will create one extra incident task1 every time you create an incident task1, this doesn't seem like a solution to the requirement. 

Since you create a new incident task1 with the business rule, this one might as well trigger the same business rule again and you'll end up with a lot of incident tasks.

There is no need to write a business rule here, the only thing needed is to create a reference field on the incident task1 table and the reference should be to incident table. This will automatically create the relation between the 2 tables.

Hi,

this business rule will execute only one time whenever we insert record at first time into "incident_task".

again 

if we have many task with same incident then that much entry should be preset into this relation table.

right?

please correct me if i am wrong?

 

thanks