Skip to content

Commit 7b334f7

Browse files
committed
Addede readme file and a example Excel file
-Moved all the files to the correct folder "/examples/node-js-import-cards-with-excel". -Added a readme.md file instead of having the documentation inside the main JS file. -Added "nodejs_cards.xlsx" file as the example file for others.
1 parent 70ceca7 commit 7b334f7

3 files changed

Lines changed: 28 additions & 14 deletions

File tree

Complete examples/Import_Cards_From_Xlsx.js renamed to examples/node-js-import-cards-with-excel/Import_Cards_From_Xlsx.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
/*
2-
This script uses the node "xlsx" libraray to read a .xlsx file and then read the content to
3-
figure out the user attributes in the first row/header.
4-
This means that you do not have to arange the order of the attributes in the header to make it work.
5-
The script checks to see that you do not have too few attributes in the header nor too many.
6-
After that the script creates a json object for each Card and sends it to the API endpoint: projects/<Workspace/Project ID>/cards/create-new
7-
8-
Headers that will be used: "Due date" "Description" "Assignee" "Title" "Label" "Points" "Estimated time" "Blocked reason" "Column" "Checklist" "Co-assignees" "Activity" "Board id".
9-
If you have more headers that are not on the list above, then they will not be used, however you will not get any errors for having them.
10-
11-
Information about the headers see the API documentation: https://service.projectplace.com/apidocs/#base/projects/1/projects/%3Cint:project_id%3E/cards/create-new
12-
13-
*/
14-
151
const xlsx = require('node-xlsx');
162
const request = require('request');
173
const prompt = require('prompt-sync')();
8.67 KB
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Upload Cards from Xlsx file
2+
This NodeJS script reads the provided Xlsx file and creates Cards to the correct Board/Activity.
3+
The script requires a Oauth2 token in order to make the API calls to create the Cards, it will assume that you have already created one.
4+
#### 1. Install requirements
5+
See the `requirements.txt` file for the needed third-party libraries.
6+
#### 2. Run the script
7+
```
8+
node Import_Cards_From_Xlsx.js
9+
```
10+
#### 3. Provide the necessary information
11+
* The script will ask first for your access token (Oauth2 token).
12+
* Then it will ask for the Workspace ID of where Board that you have provided in the Xlsx is located.
13+
* Lastly the script will ask the exact path for the Xlsx file.
14+
15+
##### Note file name location
16+
If the Xlsx file is in `c:/User` folder, then you should provide the path as: `c:/user/FILENAME.xlsx`.
17+
18+
##### See the test Xlsx file named: ```nodejs_cards.xlsx```
19+
Headers that will be used: **Due date, Description, Assignee, Title, Label, Points, Estimated time, Blocked reason, Column, Checklist, Co-assignees, Activity, Board id.**
20+
If you have more headers that are not on the list above, then they will not be used, however you will not get any errors for having them.
21+
***The headers does not have to be arange in any order for the script to work.***
22+
23+
24+
1. The script will get all the headers from the Xlsx file.
25+
2. Create a JSON object for each of the Cards.
26+
3. Lastly it will send the JSON object to the API endpoint: ```/cards/create-new```
27+
4. If any of the Cards failed to import then you will see those Cards in the console once the script is done.
28+

0 commit comments

Comments
 (0)