Last active
September 16, 2020 00:44
-
-
Save iaindooley/132d78cf547af7aa219c8302cdbb19cf to your computer and use it in GitHub Desktop.
Duplicate cards on search pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var board_id = new Board({link: "https://trello.com/b/qTCYep6l"}).id(); | |
var page = 0; | |
var cont = true; | |
var all_ids = []; | |
while(cont) | |
{ | |
cont = false; | |
var url = "search?query=is:open&idBoards="+board_id+"&modelTypes=cards&partial=true&board_fields=name%2CidOrganization&boards_limit=1000&card_fields=all&cards_limit=10&cards_page="+page+"&card_attachments=false&organization_fields=name%2CdisplayName&organizations_limit=10&member_fields=avatarHash%2CfullName%2Cinitials%2Cusername%2Cconfirmed&members_limit=10"; | |
new IterableCollection(TrelloApi.get(url).cards).each(function(elem,key) | |
{ | |
cont = true; | |
var cur_id = new Card(elem).id(); | |
if(all_ids.indexOf(cur_id) > -1) | |
{ | |
console.log("Duplicate id: "+cur_id+" found at element: "+key+" on page: "+page); | |
} | |
else | |
{ | |
all_ids.push(cur_id); | |
} | |
}); | |
page++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment