Can i call script include from scripted rest api

mounika7675
Tera Contributor

Hi,

 

Is there is a way where we can call script include (global scope) from Scripted Rest Api ( different scope than global)?

 

Thanks in Advance😊

2 REPLIES 2

Harish KM
Kilo Patron

Hi @mounika7675 yes you can call,  ensure your script include accessible from field is set to all application scope and in Scripted Rest api you can call like this

var si = new global.scriptincludeName().functionName();

Regards
Harish

Wasd123
Tera Expert

Hi Ash,

sure you should be able to do it. Since you have mentioned that it is in a different scope I would try something like that:
Lets say your script include name is: "MyScriptInclude"
"var myinclude = new script_include_scope_prefix.MyScriptInclude();"

of course remmeber to replace the script include name to the one you have and replace
"script_include_scope_prefix" with the actual scope value.

If helps please mark it as useful or accept it as a solution.