Unable to add tags to a new vlan in 'scripts' #4796

Closed
opened 2025-12-29 19:20:35 +01:00 by adam · 0 comments
Owner

Originally created by @PieterL75 on GitHub (Apr 19, 2021).

NetBox version

v2.11.0

Python version

3.7

Steps to Reproduce

Create a new script with a portion to create a new vlan with tags
vlangroup=VLANGroup.objects.get(id=3)
newvid = '1234'
vlanname = "testvlan"
newvlan = VLAN(
vid = newvid,
name = vlanname,
group = vlangroup,
tags = [3,9,16]
)
newvlan.save()

The 3,9,16 are valid IDs for tags.

Expected Behavior

A new vlan is created, with the 3 tags assigned to the vlan

Observed Behavior

The vlan is created, but no tags are seen on the vlan.
I tried several methods of adding values to the vlan (single number, array of numbers, array of tag-objects), but I never get the tags on the newvly created vlan

Originally created by @PieterL75 on GitHub (Apr 19, 2021). ### NetBox version v2.11.0 ### Python version 3.7 ### Steps to Reproduce Create a new script with a portion to create a new vlan with tags vlangroup=VLANGroup.objects.get(id=3) newvid = '1234' vlanname = "testvlan" newvlan = VLAN( vid = newvid, name = vlanname, group = vlangroup, tags = [3,9,16] ) newvlan.save() The 3,9,16 are valid IDs for tags. ### Expected Behavior A new vlan is created, with the 3 tags assigned to the vlan ### Observed Behavior The vlan is created, but no tags are seen on the vlan. I tried several methods of adding values to the vlan (single number, array of numbers, array of tag-objects), but I never get the tags on the newvly created vlan
adam added the type: bug label 2025-12-29 19:20:35 +01:00
adam closed this issue 2025-12-29 19:20:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4796