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

RaghavSh
Kilo Patron

user below:

current.cat_item; // to get catalog item sys_id.

Reason: since you are on variable and catalog item field is a reference field, so it will give you sys_id.
Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

Thanks for your response, but current.cat_item seems not work in Reference qualifier field of variable. The way i try is as folows:
sys_id=javascript: new scripInclude().scripIncludeFunction(gs.getUserID(), current.cat_item)

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

Thanks! removing sys_id did the trick