Script Include Passing Variable

ABC6
Tera Contributor

Hello team,
I have a requirement where i need to send a notification based upon priority
in an script include i used like this and passed it over BR ,Please guide me if this the correct way to pass priority as a variable

ABC6_0-1709196074169.png

 

ABC6_1-1709196074068.png

 

 

1 ACCEPTED SOLUTION

Nick Parsons
Mega Sage

No, that is not the correct way to add instance fields to a script include. Also, the way you use it completely depends on what smsObj is in your example code. If it is an instance of your TwillioPropVal (created using something along the lines of var smsObj = new TwilliooPropVal()) then you should add your values in the initialize method like so:

 

initialize: function() {
  this.base_Class = ["incident", "task_sla"];
  this.priority_Sms = ['1', '2'];
},

 

 However, I would suggest using static members. See my answer here on how to do that.

View solution in original post

3 REPLIES 3

Nick Parsons
Mega Sage

No, that is not the correct way to add instance fields to a script include. Also, the way you use it completely depends on what smsObj is in your example code. If it is an instance of your TwillioPropVal (created using something along the lines of var smsObj = new TwilliooPropVal()) then you should add your values in the initialize method like so:

 

initialize: function() {
  this.base_Class = ["incident", "task_sla"];
  this.priority_Sms = ['1', '2'];
},

 

 However, I would suggest using static members. See my answer here on how to do that.

How this Line i will use in Br Then

this.prriority_Sms = ['1', '2'];

Depends on what smsObj is, but it should be smsObj.priority_Sms if smsObj is an instance of your script include (also I had a typo in my answer, I used 3 "r"s in priority by accident. Please see my edit above).