Skip to content
Discussion options

You must be logged in to vote

Hi @IsarNet-Joe,

The user filter is available and accepts a username, so a static value such as query_params={'user': 'alice'} should work as expected.

The issue here is the point at which script variables are created. They are defined as class attributes when the script module is loaded. At that time, there is no active HTTP request or Script instance, so neither request.user nor self.request is available. NetBox assigns self.request only when the submitted script starts running, after the form has already been created, displayed, and validated.

query_params currently supports static values and references to other script fields using $field_name, but it cannot dynamically resolve the cur…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by IsarNet-Joe
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants