Using Asana events API for task monitoring -
i'm trying use asana events api track changes in 1 of our projects, more specific task movement between sections. our workflow follows:
- we have project divided sections.
- each section represents step in process. when 1 step done, task moved section below.
- when given task reaches specific step want pass external system. doesn't have full info - basic things + url enough.
my idea use https://asana.com/developers/api-reference/events implement pull-based mechanism obtain recent changes in tasks.
my problems are:
- events api seem generate lot of information, not useful ones. moving 1 single task between sections generates 3 events (2 "changed" actions, 1 "added" action marked "system"). during work many tasks moved between many sections, i'm interested 1 in 1 specific sections. how can finds items moved section? know there's resource->text field, gives me moved x y (projectname) human readable message might change in future
- according documentation resource key should contain task data, info see id , name not enough case. possible hold on tags using events api? or other data allow classify tasks in our system?
- can listen events specific section instead of tracking whole project?
ideas or suggestions welcome. thanks
in short:
- yes, answer below.
- yes, answer below.
- unfortunately not, sections tasks bit of functionality. api represents relationship between sections , tasks in them via
memberships
field on task , not other way.
this should achieve looking for, think.
let's have project ninja pipeline
2 sections novice
& expert
. keep in mind, sections tasks name ends :
character few features in tasks can belong them.
events "bubble up" children parents; therefore, when wombat
task in project form novice
section expert
3 events. starting top level going down, are:
- the
ninja pipeline
project changed. - the
wombat
task changed. - a story added
wombat
task.
for use case, interesting event second 1 task changing. data want know task changed value of memberships
field on task. if member of section interested in, take action, otherwise ignore.
by default, many resources in api represented in compact form includes id
& name
. use input/output options in order expand objects or select specific fields need.
in case best bet include query parameter opt_expand=resource
when polling events on project. should expand of resource
objects in payload. events of type: "task"
if resource.memberships[0].section.id=<id_of_the_section>
true, take action, otherwise ignore.
Comments
Post a Comment