- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:13 PM
Hi guys
Would you know how to convert this condition "Assignment Group | is (dynamic) | One of my groups" into a URL query? I need to pass it to my data.url object within Service Portal.
Here's what I tried so far but it's not working at the moment..
data.url = '/table_list.do?sysparm_query=active=true^assignment_group=' + gs.getUser().getMyGroups().toArray().join();
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:32 PM
Thanks Abhinay. This is what worked:
data.url = "/table_list.do?sysparm_query=active=true^assignment_groupIN"+ gs.getUser().getMyGroups().toArray().join();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:16 PM
Try this
data.url = '/table_list.do?sysparm_query=active=true^assignment_group=' javascript: gs.getUser().getMyGroups().toArray().join();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:19 PM
Since it can return multiple groups, use IN operator as shown below
data.url = '/table_list.do?sysparm_query=active=true^assignment_groupIN' javascript: gs.getUser().getMyGroups().toArray().join()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:22 PM
Thanks Abhinay. This is not working. Also I am already in the Widget's Server Script..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:26 PM
Oops, missing a '+' in the url. Use this
data.url = '/table_list.do?sysparm_query=active=true^assignment_groupIN'+javascript: gs.getUser().getMyGroups().toArray().join()