--- title: "r-reports-from-trello" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{r-reports-from-trello} %\VignetteEngine{knitr::rmarkdown} \usepackage[utf8]{inputenc} --- # Overview The goal of the Repello package is to obtain information from a Trello board and view the contents in a more user-friendly fashion. This package will allow a user to store the information from Trello cards, including card checklists and date of last modification. The package also allows two saved Trello objects to be compared to check for changes to the status and items of card checklist tasks. # Installation ```{r, eval=FALSE} install.packages("repello") ``` # Getting Started ## Loading supplementary packages ```{r, warning=FALSE} suppressPackageStartupMessages(require(repello)) #Note: you may want to also install the following packages for well-formatted report tables suppressPackageStartupMessages(require(knitr)) suppressPackageStartupMessages(require(kableExtra)) ``` ## Setting the user token Using this package requires you to have your own Trello account. This package obtains information from Trello boards using API calls. To access Trello information, you first need to obtain your unique user key and token. Access to these can be found by logging into Trello and visiting `https://trello.com/app-key`, then by clicking on "Manually generate a token". Once you have generated your key and token, you can either save it into a text file somewhere on your computer or you may manually enter them when prompted. If you opt to save them as text files on your computer, be sure to set your working directory to the file location before you attempt to run the code. Setting the user token is a critical first step for using this package. Always be sure to set the token prior to using any of the other functions in this package ```{r, eval=FALSE} set_key_token(key_file="user_key.txt", token_file="user_token.txt") #Alternatively, you may leave the arguments blank and manually enter the key and token when prompted set_key_token() ``` # Viewing information for a specified Trello board All you need to get started with the Repello package is the name of the board you want to view. This example will use the board "Repello - R Reports from Trello". You can access this board on Trello for reference at https://trello.com/b/CMNHqjea/repello-r-reports-from-trello. The cards_info function allows you to view the card information from a board. ```{r, eval=FALSE} activity <- cards_info(get_board_id("Repello - R Reports from Trello")) head(activity) %>% kable(escape=F, align="cl") %>% trimws %>% kable_styling(c("striped","bordered")) ``` ```{r, echo=FALSE} activity <- readRDS("activity.rds") head(activity) %>% kable(escape=F, align="cl") %>% trimws %>% kable_styling(c("striped","bordered")) ``` ## Checklists The all_checklists function can be used to view all card information and accompanying checklists in a list format. ```{r, eval=FALSE} trello_object <- all_checklists("Repello - R Reports from Trello", save=FALSE) #save can be set to 'TRUE' if you want to save the current Trello object for #later comparison trello_object[[4]] ``` ```{r, echo=FALSE} trello_object <- readRDS("trello_object.rds") trello_object[[4]] ``` Viewing a sample of one of the board's cards, you can see that six different pieces of information are presented: the name of the card, the card ID, the date of last modification, the Trello list the card is on, and the items and their respective status on a card checklist. If no list is present, the only item will be "No checklist for this project. ```{r} trello_object[[2]] ``` # Comparing two Trello objects One of the main goals of this package is to compare the Trello board at two different time points to check for changes made to the checklists. The trello_updates function can locate any new tasks or status changes made to the Trello cards, and can also determine if any new cards have been added since the last saved object. ```{r, eval=FALSE} report <- trello_updates("Repello - R Reports from Trello", prior="old_object.rds", save=FALSE) #Note: If 'prior' is not specified, the function will automatically find the most recent saved #Trello object to compare to the current rendition. The function can also accept a 'recent' #argument if you want to compare two lists from different time points. report[[4]] ``` ```{r, echo=FALSE} report <- readRDS("report.rds") report[[4]] ``` If a card appears on the newest Trello object, but was absent from the prior rendition, it will be marked as a new card and all checklist items will be considered new items. ```{r} report[[5]] ``` Some cards do not have checklists. If this happens, repello will leave the list_diff element empty for the card. ```{r} report[[2]] ``` # Creating a Trello Report The following code is used to create a kable-formatted report of the tasks and status of items for each checklist on a recent Trello object compared to a prior Trello list from the same board. The functions used above are utilized here. ```{r, eval=FALSE} set_token("user_token.txt") report <- trello_updates("Repello - R Reports from Trello", prior="old_object.rds", save=FALSE) ``` ```{r, results='asis'} new_sticker <- "