Tag task based on who commented last


#1

I’m getting ready to write a script that will take a given task, look at its stories (comments), look at who posted last to the comment, and create a tag of a certain color based on whether the user is a member of the development team or not. My current questions are:

  • is it possible to sort by date so that I can get only the most recent story?
  • is there an easy way to identify the poster as a member of our development team or not?

Cheers!


#2

Welcome to the community!

I’d say you need to get all the stories and order them yourself https://asana.com/developers/api-reference/stories#get-all

I am surprised to not find an endpoint to get a user team. Maybe you need to get all the teams and find out yourself https://asana.com/developers/api-reference/teams#users

@Phil_Seeman @lpb @Diakoptis any idea?


#3

Hi @Paul_Clerc and thanks @Bastien_Siebman,

https://app.asana.com/api/1.0/users/me/teams?organization=:gid&opt_pretty

returns an array of objects for user “me” that include a name property which is the team name, so if one of them matches “Development” the user is a team member.

@Joe_Trollo, I think the API documentation is missing mention of the need for the parameter organization=:gid, right?

Thanks,
Larry


#4

:champagne: thanks a lot Larry


#5

Thanks so much for the replies gents. Much appreciated!

Paul