How to override Read-only API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2024 09:20 PM
Hi, everyone.
I want to override the API that links Case and Incident: CSMIncidentIntegrations.
Based on information in KB0817494, a field that is not specified in OOB was successfully federated.
However, you cannot change the target of the field specified in OOB.
I would like to set the Case Assigned to the Incident Caller.
This is the script I tried.
If you know, please tell me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 01:58 AM
Hi @Yudai Yamamoto ,
I'm not completely sure I fully understand the issue, but let me try.
The incident caller is the contact from the company that created the case.
The Assigned to is your internal field with your own (itil) users, who will solve the incident/case.
You want the internal case owner to be the incident caller, right?
Since the script include is read-only and extensions are not possible here, you can create an a-sync business rule/flow on create of an incident. That BR checks which case is linked to your incident and update the caller_id. This will create an additional update. With something like:
var grCase = new GlideRecord('sn_customerservice_case');
if(grCase.get('incident',current.getUniqueValue())){
current.setValue('caller_id',grCase.getValue('assigned_to'));
current.update();
}
Note:
- You will have an additional update, causing (potentially) multiple emails
- You can link the incident to multiple cases, the business rule should run only on insert
Regards,
Hayo