Is it possible to use local variable within script of other variable?

Hi,
I would like to create two inputs for a user task. One of them should be a JavaScript inline script that references the other input’s value.
This is what I tried:

When I execute this process I do get the following error:
ServerException: Exception occurred while deserializing response of method ‘StartProcess’. CHessianException: ReadObject: unknown code end of file

I also tried var responsible = execution.getVariable("localselection"); within the script. That resulted in a different error message:
Bpmn.BusinessProcessException: Expression did not resolve to a string or collection of strings

Is it possible to resolve the issue somehow? The reason I want work with that reference is because I would like to create an element template where the end user only sets the input (in this case localselection) as a reference to a different process variable and the other input (groups, ideally hidden to the user) works with the value.