how to autopopulate the incident field with the incident number in related records

Siva_Prasad
Tera Contributor

Hi

 we want to autopopulate the incident field with the incident number in related records section of SIR form 

Siva_Prasad_0-1761630520404.png

what is the exact solution for this ? In PDI it is working , 
-TIA

9 REPLIES 9

Siva_Prasad
Tera Contributor

Ankur Bawiskar
Tera Patron
Tera Patron

@Siva_Prasad 

when should this happen and how are you planning to populate that?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

When a new incident is created   create security incident button will be there after creation of new incident   when we create a new security incident from there , then the incident should auto populate in incident field of related records in SIR form 

Hi @Siva_Prasad ,

 

Create Sec Incident: Create/(check if existing is there) a new UI action on incident table and write logic for creating new record in sn_si_incident table copying the required field from that incident record.  Here when creating new security incident record there is field on security incident table called 'incident', populate that field the current incident number then it will automatically show in related record in incident field on SIR form. 

 

For test purpose I have created one SIR record and in incident field I populated the record from incident table it showed me incident fiend under related record. See the screenshot 

BhimashankarH_0-1761637744486.png

 

In PDI on incident table there is "Create Security Incident" button, but it does not populate the incident field on security incident table. There is Security Incident Utils you can just add one line in createFromIncident() function, it only populates the parent field as of now.

 gr.setValue('incident', currentIncident.getUniqueValue());

 

After adding above line, it will populate that incident number in incident field in related record on SIR form. 

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!