snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.84k stars 3.14k forks source link

Custom Link based on existing record #9465

Open ryanmerolle opened 3 years ago

ryanmerolle commented 3 years ago

Server (please complete the following information):

Is your feature request related to a problem? Please describe. It would be nice to create links for all items of a snipe-it data model to create links/urls using a templating language. Said custom link would have access to all fields and custom fields related to the data model.

For example I create site ids for each datacenter and not offices.

Describe the solution you'd like Example Doc: https://netbox.readthedocs.io/en/stable/additional-features/custom-links/

NetBox uses Jinja for both the text and the url creation. If I create a custom link for locations I could set conditionals in the text logic to as to whether I should display the link, and I can put conditionals in the logic for the url creation.

Example:

{"Text": "{% if location.type == "datacenter" %}{{ obj.name }} Data Center Rack Elevations{% endif %}", "URL": "https://netbox.example.com/sites/{{ obj.site_id }}"}

Describe alternatives you've considered

  1. Use a custom field for each model set as a data type of url.
  2. Statically input data into each custom field for each record.

Additional context My example uses jinja2 templating and python conditionals. In no way is this what I am suggesting, it was just an example of how a similar feature works for other projects.

welcome[bot] commented 3 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.