Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MultiObjectVar to accept input from URL in Custom Scripts #7720

Closed
rodvand opened this issue Nov 2, 2021 · 1 comment
Closed

Allow MultiObjectVar to accept input from URL in Custom Scripts #7720

rodvand opened this issue Nov 2, 2021 · 1 comment
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@rodvand
Copy link
Contributor

rodvand commented Nov 2, 2021

NetBox version

v3.0.8

Feature type

New functionality

Proposed functionality

Allow a MultiObjectVar to be pre-filled using a URL. This currently works for ObjectVar. Example of ObjectVar script:

from extras.scripts import *
from virtualization.models import VirtualMachine

class ObjectVarTest(Script):
    vm = ObjectVar(
            model=VirtualMachine
            )

    def run(data, commit):
        pass

Here you can pre-fill the variable by passing ?vm=<ID> like this https://your.netbox.install/extras/scripts/ob_var.ObjectVarTest/?vm=13.

Change the variable to a MultiObjectVar and try passing multiple values (https://your.netbox.install/extras/scripts/ob_var.ObjectVarTest/?vm=13&vm=37) . It does not currently work.

Use case

Allow a user to go straight to a custom script with some data pre-filled.

Database changes

None

External dependencies

No response

@rodvand rodvand added the type: feature Introduction of new functionality to the application label Nov 2, 2021
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Nov 11, 2021
@jeremystretch jeremystretch self-assigned this Nov 17, 2021
@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application and removed type: feature Introduction of new functionality to the application labels Nov 17, 2021
@jeremystretch
Copy link
Member

Really a bug rather than a feature. This works as expected with the same type of field elsewhere in NetBox.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants