Mass updating tickets with Tags

Mass updating tickets with Tags

We are wanting to use tags as a way of grouping tickets that share similar concerns/problems.   We have about 8000 historical tickets that we would like to update the tags for.     We would like to use a custom field (existing) for the tag name for these historical tickets.      How can we achieve this?  Is there a way to write a custom function that could get the custom field value and add a tag with the same name?