cancel
Showing results for 
Search instead for 
Did you mean: 

Script to AutoPopulate Team on New C4C Ticket Seems to Break Ticket Routing Rules

0 Kudos
194

Hi,

I wrote logic to autopopulate the team on a newly created ticket in C4C, before the ticket is saved. Current system functionality provides the team only if the agent field entry is changed.

The team is based on the agent logging the manual ticket (the agent is also the logged in user). The logic is contained in the After Modify event. The file is Event-AfterModify.absl

import AP.FO.BusinessPartner.Global;

// NM 28/08/23

if (this.ProcessorParty.IsSet()) {

if (!this.ServiceSupportTeamParty.IsSet()) {
//this.ServiceSupportTeamParty.Delete();



var itemData : elementsof Employee;
var team : elementsof ServiceRequest.Party;

var ProcessorEmployee = this.ProcessorParty.Party.Employee;
var HDTeam = this.ProcessorParty.PartyKey.PartyID;

//team.PartyKey.PartyID.content = this.ProcessorParty.;
//ProcessorEmployee.CurrentOrganisationalUnitAssignment.
//Employee.CurrentOrganisationalUnitAssignment.ReportingLineIndicator
foreach (var orgUnit in ProcessorEmployee.CurrentOrganisationalUnitAssignment) { 

	if (orgUnit.ToRoot.CurrentFunctions.ServiceOrganisationIndicator == true) {
		team.PartyKey.PartyID.content = orgUnit.ToRoot.ID;
		this.ServiceSupportTeamParty.Create(team);
	}
}

//if (ProcessorEmployee.CurrentOrganisationalUnitAssignment.GetFirst().ToRoot.CurrentFunctions.ServiceOrganisationIndicator == true) {
//team.PartyKey.PartyID.content = ProcessorEmployee.CurrentOrganisationalUnitAssignment.GetFirst().ToRoot.ID;
this.ServiceSupportTeamParty.Create(team);

}
}

The script works to autopopulate the team before a manual ticket is saved,

But when the status of the ticket changes through its lifecycle, ticket routing rules no longer work

I wondered if the script might be affecting "Maintain Determinations" on Service and Support Team under Business Configuration > Overview > Select "Tickets for Customer Support"

Note that the rules work if the logic we added is removed.

Accepted Solutions (0)

Answers (0)