How to pass a Jira Service desk context parameter into a JSM portal user menu

We are working on new user menu action in the JSM portal: The displayed context would depend on which portal (or ServiceDesk project) the user opens it from. I wanted to use the URL context parameters for this (as the documentation suggests), but all Jira Context parameters come through empty. Even the servicedesk.serviceDeskId, stated to be available from the Portal page, does not give any result.

The user I am currently testing with is logged in and is the site and org admin, so there should not be any limitations for that user particularly, right?
Any suggestions on accessing information about the displayed portal from which the user has opened the user menu?