{"id":23287,"date":"2022-12-22T10:11:03","date_gmt":"2022-12-22T01:11:03","guid":{"rendered":"https:\/\/www.skyarch.net\/blog\/?p=23287"},"modified":"2022-12-22T10:11:03","modified_gmt":"2022-12-22T01:11:03","slug":"python-jira-%e3%81%a7%e8%aa%b2%e9%a1%8c%e6%93%8d%e4%bd%9c%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/python-jira-%e3%81%a7%e8%aa%b2%e9%a1%8c%e6%93%8d%e4%bd%9c%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f\/","title":{"rendered":"Python JIRA \u3067\u8ab2\u984c\u64cd\u4f5c\u3057\u3066\u307f\u305f"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p><a href=\"https:\/\/jira.readthedocs.io\/\" target=\"_blank\" rel=\"noopener\">Python JIRA<\/a> \u3067\u3001\u8ab2\u984c\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u3068\u540c\u3058\u3088\u3046\u306a\u5185\u5bb9\u3067\u8ab2\u984c\u3092\u4f5c\u6210\u3059\u308b\u306e\u304c\u30b4\u30fc\u30eb\u3067\u3059\u3002<br \/>\n(JIRA \u3092\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u3057\u305f\u6642\u306b\u51fa\u6765\u308b\u3001\u30c7\u30e2\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306e\u30b5\u30f3\u30d7\u30eb\u8ab2\u984c\u306b\u671f\u65e5\u306a\u3069\u3092\u8a2d\u5b9a\u3057\u305f\u3082\u306e)<\/p>\n<a href=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-23288\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09-1024x653.png\" alt=\"\" width=\"728\" height=\"464\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09-1024x653.png 1024w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09-300x191.png 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09-768x490.png 768w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09-360x230.png 360w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09-728x464.png 728w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h24_09.png 1320w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u7d4c\u7531\u3067\u65e2\u5b58\u306e\u8ab2\u984c\u306e\u5165\u529b\u5024\u3092\u53c2\u7167\u3057\u3001\u540c\u3058\u3088\u3046\u306a\u8ab2\u984c\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h1>JIRA \u306e\u8a8d\u8a3c\u60c5\u5831\u8a2d\u5b9a<\/h1>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b JIRA \u306e\u8a8d\u8a3c\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom jira import JIRA\r\n\r\njira = JIRA(\r\n    server='&#x5B;Atlassian \u306e URL]',\r\n    basic_auth=('&#x5B;\u30e6\u30fc\u30b6\u30fc\u540d]', '&#x5B;API Key]')\r\n)\r\n<\/pre>\n<p>Atlassian \u306e URL \u306f <code>https:\/\/xxxx.atlassian.net\/<\/code> \u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<h1>\u65e2\u5b58\u306e\u8ab2\u984c\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3001\u8868\u793a<\/h1>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65e2\u5b58\u306e\u8ab2\u984c(DESK-9)\u306e\u5165\u529b\u5024\u306a\u3069\u3092\u53d6\u5f97\u3001\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef print_issue() -&gt; None:\r\n    issue = jira.issue('DESK-9')\r\n    pprint(issue.raw)\r\n\r\nprint_issue()\r\n<\/pre>\n<p>\u5b9f\u969b\u306b\u8868\u793a\u3057\u305f\u3082\u306e\u304c\u4ee5\u4e0b\u3067\u3059\u3002(\u60c5\u5831\u91cf\u304c\u591a\u3044\u305f\u3081\u3001\u304b\u306a\u308a\u524a\u3063\u3066\u3044\u307e\u3059)<br \/>\n\u300c\u30ea\u30af\u30a8\u30b9\u30c8\u30bf\u30a4\u30d7\u300d\u3092\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306b <code>customfield_10010<\/code> \u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306a\u3069\u3001\u521d\u898b\u3067\u306f\u89e3\u8aad\u306b\u306a\u304b\u306a\u304b\u6642\u9593\u304c\u304b\u304b\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<pre>{\n  'fields': { 'project': {'id': '10001',\n                          'key': 'DESK',\n                          'name': '\u30c7\u30e2 \u30b5\u30fc\u30d3\u30b9 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8',\n                          'projectTypeKey': 'service_desk',\n                          'simplified': False},\n              'summary': '\u512a\u5148\u5ea6\u306e\u9ad8\u3044\u30ea\u30af\u30a8\u30b9\u30c8',\n              'description': '\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u512a\u5148\u5ea6\u3092\u78ba\u8a8d\u3057\u3066\u3059\u3070\u3084\u304f\u554f\u984c\u3092\u7279\u5b9a\u3057\u3001*\u30b5\u30fc\u30d3\u30b9\u30ec\u30d9\u30eb\u5408\u610f (SLA)* '\n              'issuetype': {'avatarId': 10551,\n                            'description': 'An IT problem or question.',\n                            'id': '10004',\n                            'name': 'IT Help',\n                            'subtask': False},\n              'priority': {'id': '1',\n                           'name': 'Highest'},\n              'duedate': '2022-12-20',\n              'customfield_10010': {'requestType': {'groupIds': ['1'],\n                                                    'helpText': '',\n                                                    'id': '2',\n                                                    'issueTypeId': '10004',\n                                                    'name': 'Computer support',\n                                                    'portalId': '1',\n                                                    'serviceDeskId': '1'}},\n              'components': [{'description': 'Issues related to Jira. Created by '\n                                             'Jira Service Management.',\n                              'id': '10000',\n                              'name': 'Jira'}],\n              'labels': ['demo-desk'],\n  'id': '10008',\n  'key': 'DESK-9',\n}\n<\/pre>\n<h1>\u8ab2\u984c\u3092\u4f5c\u6210<\/h1>\n<p>\u5148\u307b\u3069\u53d6\u5f97\u3057\u305f\u60c5\u5831\u3092\u5143\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8ab2\u984c\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef register_issue() -&gt; None:\r\n    issue_content = {\r\n        'project': {\r\n            'key': 'DESK'\r\n        },\r\n        'summary': '\u512a\u5148\u5ea6\u306e\u9ad8\u3044\u30ea\u30af\u30a8\u30b9\u30c8 (\u30b3\u30d4\u30fc)',\r\n        'description': 'n'.join(&#x5B;\r\n            '\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u512a\u5148\u5ea6\u3092\u78ba\u8a8d\u3057\u3066\u3059\u3070\u3084\u304f\u554f\u984c\u3092\u7279\u5b9a\u3057\u3001*\u30b5\u30fc\u30d3\u30b9\u30ec\u30d9\u30eb\u5408\u610f (SLA)* \u306e\u76ee\u6a19\u3092\u3088\u308a\u53b3\u3057\u304f\u8a2d\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\u969b\u3001\u9867\u5ba2\u304c\u512a\u5148\u5ea6\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u3001\u9867\u5ba2\u306b\u306f\u8868\u793a\u305b\u305a\u30c1\u30fc\u30e0\u3067\u6c7a\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002',\r\n            '',\r\n            'h3. \u8a66\u3057\u3066\u307f\u308b',\r\n            '',\r\n            '\u81ea\u5206\u3092\u62c5\u5f53\u8005\u306b\u8a2d\u5b9a\u3057\u3001*\u6700\u521d\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u307e\u3067\u306e\u6642\u9593* SLA \u304c\u30ab\u30a6\u30f3\u30c8\u30c0\u30a6\u30f3\u3059\u308b\u306e\u3092\u505c\u6b62\u3059\u308b\u30b3\u30e1\u30f3\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u89e3\u6c7a\u3057\u3066\u3059\u3079\u3066\u306e SLA \u3092\u5b8c\u5168\u306b\u505c\u6b62\u3057\u307e\u3059\u3002',\r\n        ]),\r\n        'issuetype': {\r\n            'name': 'IT Help'\r\n        },\r\n        'priority': {\r\n            'name': 'Highest'\r\n        },\r\n        'duedate': '2022-12-20',\r\n        'customfield_10010': '2',\r\n        'components': &#x5B;\r\n            {\r\n                'name': 'Jira'\r\n            }\r\n        ],\r\n        'labels': &#x5B;\r\n            'demo-desk'\r\n        ]\r\n    }\r\n\r\n    issue = jira.create_issue(fields=issue_content)\r\n    pprint(issue.key)\r\n\r\nregister_issue()\r\n<\/pre>\n<p>\u5b9f\u969b\u306b\u4f5c\u6210\u3055\u308c\u305f\u8ab2\u984c\u304c\u4ee5\u4e0b\u3067\u3059\u3002<\/p>\n<a href=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-23289\" src=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29-1024x658.png\" alt=\"\" width=\"728\" height=\"468\" srcset=\"https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29-1024x658.png 1024w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29-300x193.png 300w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29-768x493.png 768w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29-360x230.png 360w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29-728x468.png 728w, https:\/\/www.skyarch.net\/blog\/wp-content\/uploads\/2022\/12\/2022-12-20_18h27_29.png 1320w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a>\n<p><code>create_issue()<\/code> \u306e\u8fd4\u308a\u5024\u306f <a href=\"https:\/\/jira.readthedocs.io\/api.html#jira.resources.Issue\" target=\"_blank\" rel=\"noopener\">Issue<\/a> \u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3067\u3001<br \/>\n\u4f8b\u3048\u3070 <code>Issue.key<\/code> \u3067\u8ab2\u984c\u306eID(DESK-12 \u306a\u3069)\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>\u307e\u3068\u3081<\/h1>\n<p>Python JIRA \u3067\u8ab2\u984c\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f7f\u3044\u59cb\u3081\u306f\u8ab2\u984c\u3092\u4f5c\u6210\u3059\u308b\u6642\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u578b\u306a\u3069\u3092\u8abf\u67fb\u3059\u308b\u306e\u304c\u4e2d\u3005\u5927\u5909\u3067\u3057\u305f\u3002<br \/>\nstring \u306a\u306e\u304b list \u306a\u306e\u304b dict \u306a\u306e\u304b\u3001name \u3067\u6307\u5b9a\u3059\u308b\u306e\u304b id \u3067\u6307\u5b9a\u3059\u308b\u306e\u304b\u2026\u306a\u3069\u3002<\/p>\n<p>\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u3092\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u65b9\u306e\u52a9\u3051\u306b\u306a\u308c\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 Python JIRA \u3067\u3001\u8ab2\u984c\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002 \u4ee5\u4e0b\u3068\u540c\u3058\u3088\u3046\u306a\u5185\u5bb9\u3067\u8ab2\u984c\u3092\u4f5c\u6210\u3059\u308b\u306e\u304c\u30b4\u30fc\u30eb\u3067\u3059\u3002 (JIRA \u3092\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u3057\u305f\u6642\u306b\u51fa\u6765\u308b\u3001\u30c7\u30e2\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306e\u30b5\u30f3\u30d7\u30eb\u8ab2\u984c\u306b\u671f\u65e5\u306a\u3069\u3092\u8a2d\u5b9a\u3057\u305f\u3082\u306e) \u30d7\u30ed&#8230;<\/p>\n","protected":false},"author":60,"featured_media":23293,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"https:\/\/www.skyarch.net\/blog\/?p=23287","footnotes":""},"categories":[1191],"tags":[1190,65],"class_list":{"0":"post-23287","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-itsm","8":"tag-jira","9":"tag-python","10":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/23287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/60"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=23287"}],"version-history":[{"count":14,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/23287\/revisions"}],"predecessor-version":[{"id":23413,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/23287\/revisions\/23413"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/23293"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=23287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=23287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=23287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}