-
-
Save pombredanne/8f1077aa710f4053ada5272d4af7bd16 to your computer and use it in GitHub Desktop.
Copy GitHub project cards between boards
This file contains hidden or 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
import requests | |
headers = {'Authorization': 'token <ahem>', 'Accept': ' application/vnd.github.inertia-preview+json'} | |
# e.g. from https://api.github.com/repos/jnm/cuddly-doodle/projects | |
get_url = 'https://api.github.com/projects/columns/2942196/cards' | |
# e.g. from https://api.github.com/orgs/kobotoolbox/projects | |
post_url = 'https://api.github.com/projects/columns/2942356/cards' | |
source = requests.get(get_url, headers=headers).json() | |
for card in reversed(source): | |
response = requests.post(post_url, headers=headers, json={'note': card['note']}) | |
response.raise_for_status() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment