How to convert Assignment Group | is (dynamic) | One of my groups into a URL query

reginabautista
Kilo Sage

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();

1 ACCEPTED SOLUTION

reginabautista
Kilo Sage

Thanks Abhinay. This is what worked:


data.url = "/table_list.do?sysparm_query=active=true^assignment_groupIN"+ gs.getUser().getMyGroups().toArray().join();


View solution in original post

10 REPLIES 10

reginabautista
Kilo Sage

Thanks Abhinay. This is what worked:


data.url = "/table_list.do?sysparm_query=active=true^assignment_groupIN"+ gs.getUser().getMyGroups().toArray().join();


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 <


reginabautista
Kilo Sage

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.


Abhinay Erra
Giga Sage

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.


No worries