Created
October 27, 2020 13:51
-
-
Save smd877/44d8e041fb7e9f61a44e2ef1654b8ae5 to your computer and use it in GitHub Desktop.
Python2系でdateコマンドの結果をbacklogのチケットコメントに投稿するサンプル
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
import subprocess | |
import urllib, urllib2 | |
DOMAIN = 'https://[スペースID].backlog.jp' | |
API_KEY = '[APIキー]' | |
TICKET_ID = '[チケットID]' | |
API_URL = DOMAIN + '/api/v2/issues/' + TICKET_ID + '/comments?apiKey=' + API_KEY | |
contents = { | |
'content' : subprocess.check_output("date") | |
} | |
req = urllib2.Request(API_URL, urllib.urlencode(contents)) | |
res = urllib2.urlopen(req) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment