Hi Team, I am trying to automate the statuses between an entity and its respective tasks. for example, if there is a change made in the summary task of that entity, the same should be made to the animation entity status. Below is the code that I wrote for this. But there is no output received for this code. And it doesn’t seem to work. Need help!
import os
import shotgun_api3
import logging
def registerCallbacks(reg):
eventFilter = {‘Entity’:[‘CustonEntity05’],
“Shotgun_task_Change”:“sg_status_list”}
reg.registerCallback(
os.environ[BASE_URL],
os.environ[“SCRIPT_NAME_2”],
os.environ[“SCRIPT_KEY_2”],
animationrollup,
eventFilter,
None
)
reg.logger.setLevel(logging.DEBUG)
def animationrollup(sg,logger,event,args):
if event[‘meta’][‘new_value’] == None:
Entity_type = sg.find(“CustomEntity05”,(“Project”, “is”,{“id”,“is”,221}),
(‘Task_name’,‘is’,‘Animation_Summary’),
(‘step’,‘is’,{‘id’,‘is’,646}),
[“sg_status_list”]
)
batch_updates = [
{“request_type”:“update”,
“entity_type”:“CustomEntity05”,
“data”: {“sg_status_list” : None}
}for CustomEntity05 in Entity_type
if task[‘sg_status_list’] == None
]
sg.batch(batch_updates)