Hi @ababak, thanks for sharing your solution.
I have a suggestion that might be easier. I tested it and it appears to work.
You need to get hold of the app object and call the
# get the current engine instance
engine = sgtk.platform.current_engine()
panel_app = engine.apps["tk-multi-shotgunpanel"]
# use the app's navigate method to trigger a refresh.
panel_app.navigate("Project", engine.context.project["id"], panel_app.PANEL)
In the example above, I’m in a project context, so I’m just refreshing the project. But if you are in a task context then you would pass
"Task", engine.context.task["id"], ..., so that it navigates to the exact same context, but triggers a refresh.
Hope that helps?