jira lib 설치

pip install jira

Python 로직

from jira import JIRA

jira_server = 'https://jira.atlassian.com'
jira_Account = 'Username'
jira_Password = 'StrongPassword'
options = {'server':jira_server}
auth_jira = JIRA(options, basic_auth=(jira_Account, jira_Password))

jira_project = 'TEST_PROJECT'
jira_title = '[Test] Jira Page Create by Python'
jira_issue_type = 'Task'
jira_desc = 'Jira Page Create Test !'

jira_labels = 'labels_test'
jira_assignee = 'Username'

# Jira Create
new_issue = auth_jira.create_issue(project=jira_project, summary=jira_title, description=jira_desc, issuetype={'name': jira_issue_type}, labels=[jira_labels], assignee={'name': jira_assignee})

# Jira Status Change
auth_jira.transition_issue(new_issue, "Done")

# Jira Web Link Create
link_title = 'Test URL Link..'
link_url = 'https://testURL.co.kr'

param = {"url":link_url,"title":link_title}
auth_jira.add_simple_link(new_issue, param)

jira_server : 접속 jira 주소를 입력

Jira_Account : Jira 접속 계정

Jira_Password : Jira 접속 비밀번호

 

jira_project : 생성할 Jira 프로젝트명

jira_title : jira 제목

jira_issue_type : jira 이슈 타입

jira_desc : jira 상세 정보

jira_labels : labels 정보, 리스트 형식으로 1개 이상 등록 가능

jira_assignee : jira 할당자

 

link_title : 웹 링크명

link_url : 웹 링크 실제 주소

참고자료

https://jira.readthedocs.io/en/master/examples.html#authentication

 

2. Examples — jira-python 3.0.2.dev21+geb80088 documentation

Attachments let user add files to issues. First you’ll need an issue to which the attachment will be uploaded. Next, you’ll need file itself, that is going to be attachment. File could be file-like object or string, representing path on local machine.

jira.readthedocs.io

 


to Top