Adding tags via RAILS?

Infos:

  • Used Zammad version: 3.0.0-1561629709.c101f730.stretch
  • Used Zammad installation source: package
  • Operating system: deb9
  • Browser + version: none

Hey there,

was any of you guys able to add tags via rails?

Ticket.find(id) puts no tag information at all.
Ticket.find(id).tag_list puts all the tags.

I’ve not come up with any way to add and save tags to a ticket successfully
I can add tags for my output from tag_list but that’s not really helpful… :smiley:

I’ve done this with almost any other ticket attribute but tags seem to work different.

cheers

yes :smiley:

How ?

I do have a smart script doing magic. But that requires to use import_mode (which is imho a baaad idea within productive environment).

So… I fiddled and fiddled around.
This is what I got:

Ticket.find(1).tag_add('test', 1)

or long:

ticket = Ticket.find(1)
ticket.tag_add('test', 1)

Above will add a tag to a specific ticket at a time. It’s mandatory to also supply the created_by_id. In the above example I used 1 for system.

Hope that helps :wink:

1 Like

Yup, this helps!

Thanks a lot :slight_smile:

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.