challenges with IndexOf function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 07:29 AM - edited 12-06-2023 11:02 PM
Hi Team,
Am facing challenges with the IndexOf function.
below is the requirement:
Based on the Short description Assignment group should be updated.
below are the keyword and assignment groups.
If the short description contains any below keywords respective assignment group should populate in the assignment group field.
Keyword | Assignment group |
Late charges | Account department |
Smart charges | SNTP department |
Site Visit charges | SNTP department |
Other charges | Account department |
I have Created two different system properties for Above Assignment groups.
Properties are:
Account Department: Late charges, Ot.her Charges
SNTP Department: Smart charges, Site Visit charges.
My code:
Var circuitReference="Issues are related to Late charges"
Var exclude_identifier = gs.getProperty("Account department").toLowerCase().split(",");
circuitReference = circuitReference.toLowerCase();
for (var key in exclude_identifier) {
if (circuitReference.indexOf(exclude_identifier[key]) != -1) {
current.u_assignment_group = 'Account department';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 05:43 AM
try removing this line as it is converting it to small case:
Var circuitReference="Issues are related to Late charges"
Var exclude_identifier = gs.getProperty("Account department").toLowerCase().split(",");circuitReference = circuitReference.toLowerCase();
for (var key in exclude_identifier) {
if (circuitReference.indexOf(exclude_identifier[key]) != -1) {
current.u_assignment_group = 'Account department';
}
}