0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

jira-python ライブラリを使うときに調べたこと

Posted at

ライブラリのドキュメント:
https://jira.readthedocs.io/en/master/index.html

認証
# SSL 認証無効化したい場合   options = {'server':'https://jira.vplatf.com', 'verify':'False'}
options = {'server':settings.JIRA_URL}
jira = JIRA(options, basic_auth=(settings.JIRA_USER, settings.JIRA_PW))
example.py
issue = jira.issue('XXX')  # 特定チケット選択, XXXはjiraのキー
a = issue.fields.summary  # タイトル
b = issue.fields.priority # 型 <class 'jira.resources.Priority'>
b_str = issue.fields.priority
c = issue.fields.components  # 型 [<JIRA Component: name='XXX', id='000'>]
print(c[0])  # XXX
print(c[1])  # 000
d = issue.fields.customfield_XXX  # カスタムフィールドの値、XXXはフィールドID
e = issue.fields.reporter  # 型 <class 'jira.resources.User'>
f = issue.key  # チケットのキー
g = issue.fields.issuetype  # チケットのタイプ



# チケット検索例:プロジェクト名が「ABC」 + カスタムフィールドIDが145の値が「空欄/ない」 + チケットタイプが「バグ」
list_jira = jira.search_issues('project=ABC and cf[145]~None and issuetype=Bug')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?