본문 바로가기
Python

jira-python 예제

by 앗사비 2020. 3. 31.
728x90

코맨트 추가

# https://jira.readthedocs.io/

from jira import JIRA

server = "https://"
user = ""
password = ""

server = {'server': server}
jira = JIRA(options=server, basic_auth=(user, password))

issue  = jira.issue("TEST-5")
jira.add_comment ( issue , "Comment text" )

 

 

워크로그 조회

# https://jira.readthedocs.io/

from jira import JIRA

server = "https://"
user = ""
password = ""

server = {'server': server}
jira = JIRA(options=server, basic_auth=(user, password))

issues_in_project = jira.search_issues(
    'worklogAuthor = testuser',
    fields=["worklog"],
    maxResults=False
    )

for value in issues_in_project:
    print(value.fields.worklog.worklogs)
    log_entry_count = len(value.fields.worklog.worklogs)
    for i in range(log_entry_count):
        print(
            value.key, 
            value.fields.worklog.worklogs[i].timeSpent, 
            value.fields.worklog.worklogs[i].updated, 
            value.fields.worklog.worklogs[i].updateAuthor
            )
728x90