Is there a way to query all projects for a given user has been assigned at least one task on?
I want the returned list of projects to contain a specific list of fields that I’ve determined?
I tried using the summaries option but it doesn’t return what I need. In my case I need each project’s name, code, id
in return.
This was my attempt but not quite ideal
result = shotgun.sg.summarize(entity_type='Task',
filters = [
# ['entity.Shot.sg_sequence', 'is', {'type': 'Sequence', 'id': 2}],
# ['sg_status_list', 'is_not', 'na'],
['task_assignees.HumanUser.login', 'contains', 'jmartini']
],
summary_fields=[
{'field': 'id', 'type': 'count'},
{'field': 'project.Project.id', 'type': 'maximum'}
],
grouping=[
# {'field': 'project', 'type': 'exact', 'direction': 'asc'},
{'field': 'project.Project.code', 'type': 'exact', 'direction': 'asc'}
]
)
projects = [r['group_value'] for r in result['groups']]
print(projects)
for r in result['groups']:
print(r)