- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 07:44 AM
Hello,
I am trying to set the impact of an incident based on criteria selecting from a user in variables.
I have run the below script through the debugger and there are no errors, and it runs each 'if' statement as expected, but the impact value is never set on the created record. I do have a template but it doesn't touch the impact field.
Furthermore, the short description also updates, so the script is definitely running.
Any help would be appreciated.
var sd = producer.short_description = "VitalPulse Issue: ";
var issue = producer.u_issue_type.getDisplayValue();
var who = producer.u_who_is_affected;
var whoDisplay = producer.u_who_is_affected;
current.short_description = sd + issue + " - " + whoDisplay;
if (who == 'u_single_user'){
current.impact == "4";
}
if (who == 'u_multiple_users'){
current.impact == "3";
}
if (who == 'u_all_users'){
current.impact == "2";
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 07:53 AM - edited 08-01-2023 07:54 AM
You need to update each current.impact to have 1 equals sign. 1 equal sign is an assignment, 2 is a comparison operator.
var number = 0;
number = 1; // number variable is now the value 1
number == 1; // returns true as we are checking if the variable value equals 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 07:53 AM - edited 08-01-2023 07:54 AM
You need to update each current.impact to have 1 equals sign. 1 equal sign is an assignment, 2 is a comparison operator.
var number = 0;
number = 1; // number variable is now the value 1
number == 1; // returns true as we are checking if the variable value equals 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 08:02 AM
Clearly had been staring at it for too long, thanks Elijah!