Custom link-like functionality for multiple selected objects (like items in device list, interface list, etc) #5813

Closed
opened 2025-12-29 19:33:02 +01:00 by adam · 2 comments
Owner

Originally created by @zshorvat on GitHub (Dec 21, 2021).

NetBox version

v3.0.10

Feature type

New functionality

Proposed functionality

When using custom links, we can pre-fill items on a custom script form, but currently there is no functionality that would allow selecting multiple object from a list and have those used in a custom script or other actions.

For custom links the user can already refer to {{obj}} with which actions can be performed, but as I understand that link is generated on render-time, so it will not be changed when the user selects or unselects things in the displayed list.

What I had in mind is a new button at the bottom of the list (we could call it custom action?) that could construct a custom link URL from the selected objects dynamically on click-time, so probably it could be linked to existing custom link functionality as long as the selected objects can be passed on as something like {{ selectedobjects }}

The action could be assigned to displayed object-list, it could even offer in-line action for single item actions.

Use case

We would like to be able to select physical interfaces of a displayed device and use those interface objects in a single custom script, best example is LAG creation, where we'd like to assign VLANs, set custom fields, etc in one go.

In this very case I would like to be able to construct my custom script call for displayed interfaces with something like:
scriptname?host={{obj}}{% for intfobj in selectedobjects %}&interface={{intfobj.id}}{% endfor %}

(haven't used loops in Jinja, so that might not work at all, but I hope you get the idea :))

Database changes

No response

External dependencies

No response

Originally created by @zshorvat on GitHub (Dec 21, 2021). ### NetBox version v3.0.10 ### Feature type New functionality ### Proposed functionality When using custom links, we can pre-fill items on a custom script form, but currently there is no functionality that would allow selecting multiple object from a list and have those used in a custom script or other actions. For custom links the user can already refer to {{obj}} with which actions can be performed, but as I understand that link is generated on render-time, so it will not be changed when the user selects or unselects things in the displayed list. What I had in mind is a new button at the bottom of the list (we could call it _custom action_?) that could construct a custom link URL from the selected objects dynamically on click-time, so probably it could be linked to existing custom link functionality as long as the selected objects can be passed on as something like {{ selectedobjects }} The action could be assigned to displayed object-list, it could even offer in-line action for single item actions. ### Use case We would like to be able to select physical interfaces of a displayed device and use those interface objects in a single custom script, best example is LAG creation, where we'd like to assign VLANs, set custom fields, etc in one go. In this very case I would like to be able to construct my custom script call for displayed interfaces with something like: `scriptname?host={{obj}}{% for intfobj in selectedobjects %}&interface={{intfobj.id}}{% endfor %}` (haven't used loops in Jinja, so that might not work at all, but I hope you get the idea :)) ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurepending closure labels 2025-12-29 19:33:02 +01:00
adam closed this issue 2025-12-29 19:33:02 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 20, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Feb 20, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Mar 22, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Mar 22, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5813