- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 08:45 AM
I have a select box variable called "name_of_application
3 Choices to select
Depending on what is selected it would create Incident to that group.
Tried below script and it only goes to last group. If I remove the last lines its always blank assignment.
Any help on what is wrong?
if(producer.name_of_application == "Sleep"){
current.assignment_group = "22f23e1fdba188544a7f5818489619ad";
} else if(producer.name_of_application == "Neurology"){
current.assignment_group = "d8ba6d004f63b6009f547f75f110c772";
} else if(producer.name_of_application == "GI"){
current.assignment_group = "4474a8de4fd95200cd3d97dd0210c703";
} else {
current.assignment_group = "6af5f36c4f321a4063fa495d0210c73f"; // default group sys_id
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 09:30 AM
Hi Tom,
I suspect that "Sleep", "Neurology", and "GI" are not the value of the question choices for the variable. The value can be different than the Text, which is what is displayed in the drop-down box. As an example:
Value is what needs to be used in the producer script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 06:50 AM
If the existing if/else conditions are working, you would just add an OR (||) in a repeating manner:
if (producer.name_of_application == "Nihon Kohden Polysmith" || producer.name_of_application == "Somnostar - NICU Sleep" || producer.name_of_application == "Inspire Cloud software (not the device - ENT)" || producer.name_of_application == "CleveMed" || producer.name_of_application == "Philips Care Orchestrator" || producer.name_of_application == "GENE Activ") {
current.assignment_group = "22f23e1fdba188544a7f5818489619ad"; // Sleep Applications
} else if (...
or you could try a SWITCH statement.
https://www.w3schools.com/js/js_switch.asp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 01:19 PM
Brad,
Thank you for the help, Now they are asking if we can list the application and by what they select in the dropdown it will assign to one of those 3 groups. I tried just adding on the apps but get coding errors..
I can get the 1st choices to work but can't add on the rest.. see code.
So for the 1st line i need these apps to go to sleep App group, not sure how to code them in.
Nihon Kohden Polysmith
Somnostar - NICU Sleep
Inspire Cloud software (not the device - ENT)
CleveMed
Philips Care Orchestrator
GENE Activ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 06:50 AM
If the existing if/else conditions are working, you would just add an OR (||) in a repeating manner:
if (producer.name_of_application == "Nihon Kohden Polysmith" || producer.name_of_application == "Somnostar - NICU Sleep" || producer.name_of_application == "Inspire Cloud software (not the device - ENT)" || producer.name_of_application == "CleveMed" || producer.name_of_application == "Philips Care Orchestrator" || producer.name_of_application == "GENE Activ") {
current.assignment_group = "22f23e1fdba188544a7f5818489619ad"; // Sleep Applications
} else if (...
or you could try a SWITCH statement.
https://www.w3schools.com/js/js_switch.asp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 08:51 AM
Thank you for this help. It worked great.