Link case to incident

Hazel3
Tera Contributor

Hi

I need a script to implement the below use case:

When Incident is attached to the case

Then the respective related Case is shown on the Incident form via the case field.

Any suggestions?

11 REPLIES 11

Hi @Hazel3 

You can achieve this by implementing an After Business Rule to update the associated Incident record.

Sample below.

var grIncident = current.incident.getRefRecord();
grIncident.<your_field_name> = current.getUniqueValue(); //replace your Case field name
grIncident.update();

 

However, consider the scenario where a second case is linked to the same Incident, or when users unlink the Incident from the Case.

How would you like to handle such cases?

 

 

Cheers,

Tai Vu

ersureshbe
Giga Sage
Giga Sage

Hi, By default there is no OOB field available to display the case number in the incident but OOB has having related list tab is available to display the case number in the incident form. I hope it will be usable for your scenario.   Pls refer below diagram it will represent the relationship between Incident and Case as per OOB. Any reason it's not sufficient you should create a custom field and populate the case number - it's not advisable.

 

If you feel the report aspect then create a report based on the case table and put a filter condition as the incident is not empty.

 

ersureshbe_0-1700204816222.png

ersureshbe_1-1700204863100.png

 

Regards,
Suresh.