コード例 #1
0
ファイル: edit_comment.py プロジェクト: hellbentv/jira-py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import lib.jira as jira
import lib.editor as editor
import json

if __name__ == "__main__":
	if len(sys.argv) <= 2:
		print 'Usage: python %s [issueKey] [commentId]' % __file__
		sys.exit(0)
	issue_key = sys.argv[1]
	comment_id = sys.argv[2]
	try: existing_comment = jira.Comment.get(issue_key, comment_id)
	except jira.APIException, e:
		print e.response.status, e.response.reason
		print e.response.read()
	message = editor.get_input('# New comment to replace #%s (this line will be ignored)\n%s' % (comment_id, existing_comment.body)).strip()
	if existing_comment.body.strip() == message:
		print 'Comment not changed, exiting...'
		sys.exit(0)
	try: existing_comment.update(message)
	except jira.APIException, e:
		print e.response.status, e.response.reason
		print e.response.read()
コード例 #2
0
ファイル: add_comment.py プロジェクト: hellbentv/jira-py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import lib.jira as jira
import json
import lib.editor as editor

if __name__ == "__main__":
	if len(sys.argv) <= 1:
		print 'Usage: python %s [issue_key]' % __file__
		sys.exit(0)
	issue_key = sys.argv[1]
	comment = editor.get_input('# Your comment for issue %s (this line will be ignored)\n' % issue_key)
	if not comment:
		print 'No comment entered, exiting...'
		sys.exit(0)
	try:
		jira.Comment.add(issue_key, comment)
	except jira.APIException, e:
		print e.response.status, e.response.reason
		print e.response.read()
コード例 #3
0
import sys
import os

sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import lib.jira as jira
import json
import lib.editor as editor

if __name__ == "__main__":
    if len(sys.argv) <= 1:
        print 'Usage: python %s [issue_key]' % __file__
        sys.exit(0)
    issue_key = sys.argv[1]
    comment = editor.get_input('# Your worklog for issue %s (this line will be ignored)\n' % issue_key)
    if not comment:
        print 'No worklog entered, exiting...'
        sys.exit(0)
    try:
        jira.Worklog.add(issue_key, comment)
    except jira.APIException, e:
        print e.response.status, e.response.reason
        print e.response.read()
コード例 #4
0
ファイル: edit_comment.py プロジェクト: pranavraja/jira-py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import lib.jira as jira
import lib.editor as editor
import json

if __name__ == "__main__":
    if len(sys.argv) <= 2:
        print 'Usage: python %s [issueKey] [commentId]' % __file__
        sys.exit(0)
    issue_key = sys.argv[1]
    comment_id = sys.argv[2]
    try:
        existing_comment = jira.Comment.get(issue_key, comment_id)
    except jira.APIException, e:
        print e.response.status, e.response.reason
        print e.response.read()
    message = editor.get_input(
        '# New comment to replace #%s (this line will be ignored)\n%s' %
        (comment_id, existing_comment.body)).strip()
    if existing_comment.body.strip() == message:
        print 'Comment not changed, exiting...'
        sys.exit(0)
    try:
        existing_comment.update(message)
    except jira.APIException, e:
        print e.response.status, e.response.reason
        print e.response.read()