- 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: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 03:29 PM
I have never tried without javascript tag infront of scripting apis. I
think what you have is not a best practice and not usre if it works
evrywhere. Usually the javascript tag infront tells that it is scripting
api.
On Thursday, October 20, 2016, reginabautista <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 03:35 AM
Hey Abhinay maybe depending on the use case? I am using this within the Service Portal Widget, in the Server Script and it worked perfectly fine.
Adding 'javascript' did not work in my use case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 06:52 AM
My bad, I have not noticed that it is a server side script. Yep, you do not need JavaScript tag. You only need that when you are using that function in a non scripting fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 07:51 AM
No worries