- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2023 05:44 AM
Please suggest how to use script include in filter condition under change approval policy. I need to get values dynamically populated.
This is my script. Where can I add arguments (intended groups) to this script and how can the mail ID be returned
var checking_user_is_part_of_specific_Group = Class.create();
checking_user_is_part_of_specific_Group.prototype = (AbstractAjaxProcessor, {
initialize: function() {
answer = ifScript();
function ifScript() {
var ABC= gs.getProperty('ABC.grp');
var BCD= gs.getProperty('BCD.grp');
var DEF= gs.getProperty('DEF.grp');
var REH= gs.getProperty('REH.grp');
var answer;
if (gs.getUser().isMemberOf(ABC) || gs.getUser().isMemberOf(BCD)|| gs.getUser().isMemberOf(DEF)|| gs.getUser().isMemberOf(REH)){
return "yes";
} else {
return "no";
}
}
type: 'checking_user_is_part_of_specific_Group';
}
});
I need to use this script here. Please help me to understand how it can be done.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2023 05:51 AM
Hi Vignesha,
Please try
javascript: new scriptIncludeName.functionName();
OR
javascript: scriptIncludeName.functionName();
Mark Correct and helpful if it helps.
***Mark Correct or Helpful if it helps.***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2023 05:51 AM
Hi Vignesha,
Please try
javascript: new scriptIncludeName.functionName();
OR
javascript: scriptIncludeName.functionName();
Mark Correct and helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 02:58 AM
Thanks @Yousaf
That worked !!! I could use a script include as part of Filter condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 09:31 AM
javascript:new scriptIncludeName.functionName([ABC,BCD,GFH);
May I know if this will work
So comma disappears after I save
I am unable to iterate array elements

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2023 11:34 AM
I haven't tried this before but I believe you cannot call arrays like this.
***Mark Correct or Helpful if it helps.***