Events not visible when entity is retired

I just noticed that when you delete (retire) an entity, its events are no longer visible. I knew this was the case in the UI, but assumed we could get at them from the API the way you can query any other retired entity, using the find() method with the retired_only=True parameter. However, it appears this isn’t the case and there is no way to query EventLogEntries for a retired entity.

Is this a bug?

>>> sg.find("EventLogEntry", [["entity", "is", {"type": "Task", "id": 14873}]])
[{'type': 'EventLogEntry', 'id': 1096400}, {'type': 'EventLogEntry', 'id': 1096401}, ...

>>> shotgun.delete("Task", 14873)
True

>>> sg.find("EventLogEntry", [["entity", "is", {"type": "Task", "id": 14873}]])
[]

>>> sg.find("EventLogEntry", [["entity", "is", {"type": "Task", "id": 14873}]], retired_only=True)
[]

One could argue that there are cases where you still want to get this information. In my case, an entity was deleted, and as part of that deletion the field that holds the key for the entity in another system we’re integrating with was cleared. I now need to see this what the value of the key was before it was deleted. Since the value was cleared, I can’t get it from the entity itself, I have to look in the event history. But I can’t get the event history unless I revive the entity. I can’t revive the entity without triggering a lot of things I don’t want to trigger.

Just seems like this is an undocumented exception in the norms of how entities work.

4 Likes

Hey @kporangehat! Moved this to #pipeline to get the right eyes on your question!

Hey KP

I checked in with @bouchep and it sounds like this is the expected behaviour, although we can understand why you would like it to behave differently.

I’ll pop a suggestion into our product team, however as a workaround, could you trigger your workflow from the entity retired event instead? The retired event should contain information about the retired entity in the meta data field.

Best
Phil

1 Like

Thanks @philip.scadding! We’re already triggering our workflow off of the event. The issue we have is needing to look this info up later for whatever reason - without having to comb through old logs that we may or may not have access to - and not reviving the entity just for this info (which would end up triggering other things).

Good to know going forward. Probably worth some documentation somewhere too.

Thanks for the info!

2 Likes