AutoPopulate Assignment Group on Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 10:11 AM
Hello All,
Am trying to Autopopulate Assignment group field on the incident form when a new incident is created from the case record using 'Create Incident' Form Context Menu UI Action from CSM/FSM Configurable Workspace. The Autopopulate should only work when the Incident is created from the Case.
Challenges:
1. 'Create Incident' UI Action is using 'ServiceManagementIncidentUtils' OOB script include to create an incident.
2. When tried to update the Assignment group from the UI Action, it is not reading the new line code i've added.
So I have created a before 'insert' business rule, to Auto Populate the field.
Scripted as below, I also tried direct querying and incident.number to filter, I also tried changing the business rule type to After and Async but nothing works. I couldn't able to fetch the case number or case details. I don't understand what am i missing.
Is there any other way to AutoPopulate the field only when it is created from Case Record.?
current.assignment_group = 'MyassignmentGroup'
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 12:20 PM
Hello @Niharika20 ,
Just create a before insert business rule on incident table. And you below script example.
(function executeRule(current, previous /*null when async*/) {
if(current.parent.sys_class_name == "sn_customerservice_case" ){
gs.info('record is case record');
current.assignment_group = "assignment_group_sys_id"
}
})(current, previous);
Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 12:18 AM
Hello @Siddhesh Gawade
Thanks for your response. I tried your proposed solution but it is not working. I do not see any logs recorded. Also when i checked on the incident table i saw parent field is empty.
Could you suggest?
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 12:21 AM
On the incident form can you check on which the case record is populated. there should atleast one field which is populating the case record. So you can use that field instead of parent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 01:45 AM
It is populating the case number on the additional comments, but how can we use comments to fetch the record. when i tried to log comments i find nothing i just see empty log.
We have a field called incident on the case table which autopopulates when incident record is inserted