Requesting only stories that are comments

I just have a simple question, and to my knowledge I have to filter all stories on my end. I am using the Python api, and I was curious if there is anyway I can request only stories that are comments or pinned.

The reason I am asking for something like that is because when I am requesting ALL stories right now and having to find only comments or pinned comments client side it is making my script take significantly longer.

I am just creating a list of pinned comments and adding it to task[‘pinned_comments’]

task[‘pinned_comments’] = [story[‘text’] for story in client.tasks.stories(task[‘gid’],
{ “opt_fields” : “is_pinned, type, text”}) if story[‘type’] == ‘comment’ and story[‘is_pinned’] == True]

But when I have hundreds of tasks with 50+ stories it isn’t ideal.

If anyone has any ideas, it would be much appreciated! Thanks!

I’m afraid you’re correct here; you’ll have to do the filtering on your end.

1 Like

Thanks for the verification!