Skip to content

Updating custom_fields for e.g. the VirtualMachine Record does not work #101

Description

@silvermind

Custom Fields can be displayed but not updated. Not sure if this is already implemented in the gem.

netbox_identifier = 999
netbox_record= NetboxClientRuby.virtualization.virtual_machines.find_by(id: netbox_identifier)
puts netbox_record.custom_fields
netbox_record.custom_fields['my_field'] = "New Value"
netbox_record.save

completes without any error, but does not update the custom fields in netbox. Updating the name or description however works perfectly.

Activity

  1. changed the title [-]Updating custom_fields for e.g. the VitrualMachine Record does not work[/-] [+]Updating custom_fields for e.g. the VirtualMachine Record does not work[/+] on May 23, 2025
  2. silvermind commented on May 23, 2025

    @silvermind
    Author

    nevermind, if you assign the custom_fields directly it works

    netbox_record.custom_fields = netbox_record.custom_fields.merge({'my_field': "New Value"})
    netbox_record.save
  3. locked and limited conversation to collaborators on May 26, 2025
  4. converted this issue into a discussion #103 on May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions