javascript:getMyGroups() not working in business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2015 06:03 AM
Hi All,
current.addQuery('assignment_group','javascript:getMyGroups()'); is not working, Please let me know what is exactly wrong in this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 07:29 AM
I tried using only 'gs.getMyGroups()' but it is showing all the records, not working as intended
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 07:33 AM
Have you tried replacing the statement
current.addQuery('assignment_group','javascript:getMyGroups()');
with
current.addQuery('assignment_group','IN', getMyGroups());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 07:43 AM
I tried, this is also not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 07:38 AM
What are you trying to do? Is this in the incident query business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 07:43 AM
If this is a before business rule meant to filter out the records, I don't believe you can just say:
current.addQuery('assignment_group','javascript:getMyGroups()');
This isn't actually doing anything.
You need to associate these values to the var qc
var qc = current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);
also, if the code you added is only supposed to run for itil users, i would put all of the code in the 'else' section of the if at the bottom. No need to run the risk of running both sets of code.