-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmoveProjectsCards.js
More file actions
36 lines (32 loc) · 1.01 KB
/
moveProjectsCards.js
File metadata and controls
36 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* eslint-disable */
const config = require("./config");
const cardsApi = require("./cards");
console.log("Setup to retrieve cards...");
cardsApi.retrieve(config.fromCol, config.token).then(function(cards) {
cards
.slice()
.reverse()
.forEach(function(card) {
console.log(card.id + " - " + card.content_url);
cardsApi.move(card, config.toCol, config.token);
});
config.anotherCols.forEach(function(ac) {
console.log("=> " + ac.from + " - " + ac.to);
cardsApi.retrieve(ac.from, config.token).then(function(anotherCards) {
cards
.slice()
.reverse()
.forEach(function(card) {
const acs = anotherCards.filter(
anotherCard => card.content_url === anotherCard.content_url
);
acs.forEach(function(anotherCard) {
console.log(
"=> " + anotherCard.id + " - " + anotherCard.content_url
);
cardsApi.move(anotherCard, ac.to, config.token);
});
});
});
});
});