Incident Issue: Script for Setting Impact

Wasdom_Kung
Tera Guru

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";	
}


 

1 ACCEPTED SOLUTION

Elijah Aromola
Mega Sage

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

View solution in original post

2 REPLIES 2

Elijah Aromola
Mega Sage

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

Clearly had been staring at it for too long, thanks Elijah!