Access Tag Reference Tracker by Script

Is it possible to retrieve the Tag Reference Tracker log in the script?
Right now KI only can access this info from the designer tag diagnostic.
It will be really handy for searching.

There's no supported/exposed way to retrieve the information from the tag reference tracker, but like most things in Ignition, it's still possible.
I would recommend doing this on the gateway, but if you've got a gateway context already, then something like this:

from com.inductiveautomation.ignition.common.tags.config.model import TagReferenceQuery
from com.inductiveautomation.ignition.common.tags.paths import BasicTagPath

# @param activeSubscriptions True, only return references from current subscriptions to tag. False, returns all other stored references.
# @param activeSince References where the most recent activity occurred before [activeSince] will be filtered from results. 0, to ignore and return all references.
query = TagReferenceQuery(
	BasicTagPath("default", "path/to/tag".split("/")),
	False, #activeSubscriptions
	0 #activeSince
)

references = context.tagManager.getTagProvider("default").getTagReferences(query).get()
4 Likes