These functions use the connection to Microsoft Planner set up with connect_planner().

planner_browse(account = connect_planner())

planner_bucket_create(bucket_name, account = connect_planner())

planner_buckets_list(account = connect_planner(), plain = FALSE)

planner_task_create(
  title,
  description = NULL,
  startdate = NULL,
  duedate = NULL,
  requested_by = NULL,
  priority = read_secret("planner.default.priority"),
  checklist_items = NULL,
  categories = NULL,
  assigned = NULL,
  bucket_name = read_secret("planner.default.bucket"),
  attachment_urls = NULL,
  account = connect_planner(),
  project_number = planner_highest_project_id() + 1,
  consult_number = planner_highest_consult_id() + 1
)

planner_task_update(
  task,
  title = NULL,
  description = NULL,
  startdate = NULL,
  duedate = NULL,
  priority = NULL,
  checklist_items = NULL,
  categories = NULL,
  categories_keep = FALSE,
  assigned = NULL,
  assigned_keep = FALSE,
  bucket_name = NULL,
  percent_completed = NULL,
  attachment_urls = NULL,
  account = connect_planner()
)

planner_tasks_list(
  account = connect_planner(),
  plain = FALSE,
  include_completed = TRUE
)

planner_task_search(
  search_term = ".*",
  limit = 50,
  include_completed = TRUE,
  include_description = FALSE,
  account = connect_planner()
)

planner_task_find(task, account = connect_planner())

planner_categories_list(account = connect_planner())

planner_retrieve_project_id(task, account = connect_planner())

planner_task_request_validation(
  task,
  category_text = read_secret("planner.label.authorise"),
  account = connect_planner()
)

planner_task_validate(
  task,
  category_text = read_secret("planner.label.authorised"),
  account = connect_planner()
)

planner_create_project_from_path(
  path,
  projects_path = read_secret("projects.path"),
  account = connect_planner(),
  title = basename(path),
  ...
)

planner_user_property(
  user,
  team_name = read_secret("team.name"),
  account = connect_planner(),
  property = "id",
  as_list = FALSE
)

planner_highest_project_id(
  task = read_secret("planner.dummy.project.id"),
  account = connect_planner()
)

planner_highest_consult_id(
  task = read_secret("planner.dummy.consult.id"),
  account = connect_planner()
)

# S3 method for class 'ms_object'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  account = connect_planner(),
  ...
)

# S3 method for class 'ms_object'
as_tibble(x, account = connect_planner(), ...)

Arguments

account

a Microsoft 365 account to use for looking up properties. This has to be an object as returned by connect_planner() or via AzureGraph::create_graph_login()$get_group(name)$get_plan(plan_title).

bucket_name

name of the bucket

plain

return as plain names, not as Azure objects

title

title of the task

description

a description for the task. A vector of length > 1 will be added as one text separated by white lines.

startdate

a date to use as start date, use FALSE to remove it

duedate

a date to use as due date, use FALSE to remove it

requested_by

name of the person(s) who requested the task, this will be added as first line to description

priority

a priority to set. Can be ranged between 0 (highest) and 10 (lowest), or: "urgent" or "dringend" for 1, "important" or "belangrijk" for 3, "medium" or "gemiddeld" or FALSE for 5, "low" or "laag" for 9. Priorities cannot be removed - the default setting is 5.

checklist_items

character vector of checklist items

categories

names of categories to add, can be multiple, but must exactly match existing category names

assigned

names of members within the plan - use NULL to not add members in planner_task_create(), and use FALSE to remove all existing members in planner_task_update()

attachment_urls

URLs to add as attachment, can be named characters to give the URLs a title. If they are Excel, PowerPoint or Word files, a preview will be shown on the task.

project_number

the new project number to assign. Use NULL or FALSE to not assign a project number. Defaults to the currently highest project ID + 1.

consult_number

the new consult number to assign. Use NULL or FALSE to not assign a consult number. Defaults to the currently highest consult ID + 1.

task

exact task ID or title, will be searched with %like%

categories_keep

add categories that are set in categories instead of replacing them, defaults to FALSE

assigned_keep

add members that are set in assigned instead of replacing them, defaults to FALSE

percent_completed

percentage of task completion between 0-100

include_completed

also search completed tasks

search_term

search term, can contain a regular expression. When searching for project numbers (such as "p201 - Some text", or "p201" or "201"), only titles will be searched for the project number.

limit

maximum number of tasks to show

include_description

also search the description, which requires additional queries and lowers speed

category_text

text of the category to use

path

location of the folder that has to be converted to a project. This folder will be renamed to contain the new project number.

projects_path

location of the folder that contains all department projects

...

arguments passed on to planner_task_create()

user

a user name, mail adress, or Certe login name

team_name

name of the team, can be left blank to connect to an individual planner

property

property to return, can be "id", "name" or "mail"

as_list

return the full list of members as list, split into Eigenaars (Owners) / Leden (Members). This ignores user.

x

an ms_object

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional). See also the make.names argument of the matrix method.

Details

planner_task_search() searches the title and description using case-insensitive regular expressions and returns an ms_plan_task object. In interactive mode and with multiple hits, a menu will be shown to pick from.

planner_task_find() searches task title or ID, and returns an ms_plan_task object. It is used internally b a lot of planner_* functions, very fast, and does not support interactive use.

planner_retrieve_project_id() retrieves the p-number from the task title and returns it as integer.

Use planner_create_project_from_path() to convert any folder (and any location) to a project folder, by (1) assigning a project number, (2) creating a Planner task and (3) moving the old folder to the department's projects folder.

planner_highest_project_id() retrieves the currently highest project ID from the dummy project.

planner_highest_project_id() retrieves the currently highest project ID from the dummy project. planner_highest_consult_id() does this for consults.

Using as.data.frame() or as_tibble() on an ms_object, such as ms_plan_task, will return the properties and details of the object as a data.frame. For transforming many ms_objects to a data.frame, use as.data.frame() or as_tibble() in lapply() and bind the list of objects together. For example, this retrieves a tibble with the properties and details of all tasks:

library(dplyr)
planner_tasks_list() |>
  lapply(as_tibble) |>
  bind_rows()

# also works for other 'ms_object's, such as 'ms_channel':
teams_channels_list(plain = FALSE) |>
  lapply(as_tibble) |>
  bind_rows()