Get publish tree root item description in child hook

Hello! Is there a way to access the publish tree root item’s description that’s been input in the “Description” text field by the user? I’m been looking for some way to access the root item description value from inside a custom hook of a child item so any help would be much appreciated, thanks!

1 Like

Hi Viktor,
I ended up adding a property to all child items that stores a pointer to the root. It’s pretty easy to do this as any method creating a new item, already has the parent_item as a variable usually.
I also ended up using the finalise step to update descriptions on Versions and Published files depending on certain rules.
I would definitely say that the default behaviour the publisher uses isn’t ideal. I would say that if you enter a description in the root item, it should always propogate all child items unless a child item has itself a description defined… as a previous artist, clicking through those child items to add a description is the last thing I want to do in a workflow.

2 Likes

I use this snippet in my publish plugin

parent_item = item.parent
desc = item.description
while not desc and not parent_item.is_root:
    desc = parent_item.description
    parent_item = parent_item.parent
1 Like

Thanks for the ideas @jhultgre and @Patrick!

So my custom item is always the child of the root item, so I can access the root item via item.parent. However, if I call item.parent.description I always get None even if I have input some text in the “Description” field. Is the root item description stored in some other property?