How to get sys_id of current catalog item in Service Portal?

Jarkko
Tera Expert

Hi!

I'm setting up a script include for filtering users into Requested for type variable. I need to pass sys_id of current user and sys_id of current catalog item to the script include to get the filtering done, but haven't find out how to get sys_id for current catalog item in the call of the script include in Type Specifications -> (Advanced) Reference qualifier of the variable.

 

Could someone help or tell is that even possible to have?

Thanks,

- Jarkko 

1 ACCEPTED SOLUTION

The advanced reference qualifier should just contain below:

 

javascript:new scripInclude().scripIncludeFunction(gs.getUserID(), current.cat_item);

why have you put sys_id= ?

I have seen current.cat_item; working in default value of variable so it should here as well.


Raghav
MVP 2023

View solution in original post

8 REPLIES 8

But removing sys_id= raises other problem. Now it did not care the return value of script include but just list all users no matter what the script include returns?

My bad. My script include returns array of users' sys_ids. Fixed it to return encoded query like sys_isIN<list of sys_ids> and now I got what I want to my Request for drop down.

@Jarkko glad that worked!!!


Raghav
MVP 2023

Mike_R
Kilo Patron
Kilo Patron

Did you try current.cat_item  ?