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-06-2023 11:00 PM
I can do it but, the real problem is in both the properties having the keyword is charges. So there is an ambiguity to populate the assignment group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 11:03 PM
Can you please share screenshot of your properties configured in instance?
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 09:43 PM
Hi,
I don't see any issue in your script except for the first two lines variable declaration part.
You are using 'Var' instead of 'var'.
Please update below two lines :
Var circuitReference="Issues are related to Late charges"
Var exclude_identifier = gs.getProperty("Account department").toLowerCase().split(",");
Like this:
var circuitReference="Issues are related to Late charges"
var exclude_identifier = gs.getProperty("Account department").toLowerCase().split(",");
Also make sure you have correct comma separated value stored in your properties (no extra spaces);
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 11:01 PM
I tried but same result.
the real problem is in both the properties having the keyword is charges. So there is an ambiguity to populate the assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 05:42 AM
Create a table with these information with 2 string field:
Keyword | Assignment group |
Late charges | Account department |
Smart charges | SNTP department |
Site Visit charges | SNTP department |
Other charges | Account department |
It will help you to maintain the records as well in future.