Motivation-and-Behaviour / tidyMB

Templates, utilities, and style guides for use in Motivation and Behaviour Research Program
Other
0 stars 0 forks source link

Add asana integration to todo.R function #11

Open pdparker opened 4 years ago

pdparker commented 4 years ago

Use ASANA api (https://github.com/datacamp/asana) to send output from todo.R to asana

conig commented 4 years ago

I'm not familiar with the asana API, but we could use a similar interface to the todo list in order to link tags e.g. @james to whatever identifier the asana API requires: e.g.

<!--|ASANA| @taren = #15323; @phil = #15642; @james = #11532-->

Otherwise this kind of info could be provided in the function call:

construct_todo(path,
out_path = "todo.md",
asana_users = list("james" = 11532,
                   "phil" = 15642,
                   "taren" = 15323
))
pdparker commented 3 years ago

@conig and @tarensanders We could build off:

# Note you will need to store an Asana API token in your .Renvironment
library(asana)
library(dplyr)
# Get the GIDs
asana::asn_projects_find_all()

# Once you add a task, you get a tibble
test_task <- asn_tasks_create(
  projects = '<<project gid goes here>>',
  name = 'Test Task 2',
  assignee='<<user id or email goes here>>'
)

I think it would be easiest. to have asana project and users specified in an RStudio project .Rprofile file with:

asana_project='<<asana did goes here>>'

asana_users = dplyr::tribble(
  ~user, ~user_email,
  '@person', 'person@person.com'
)

and then run a wrapper for asn_tasks_create like James suggests