{"id":6458,"date":"2026-06-08T19:26:59","date_gmt":"2026-06-08T11:26:59","guid":{"rendered":"https:\/\/blog.coolcoding.cn\/?p=6458"},"modified":"2026-06-08T19:29:06","modified_gmt":"2026-06-08T11:29:06","slug":"%e8%87%aa%e5%8a%a8%e6%8b%89%e5%8f%96jira%e7%9a%84bug%e5%8d%95%e5%bd%95%e5%85%a5%e5%88%b0multica%e7%9a%84issue","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=6458","title":{"rendered":"\u81ea\u52a8\u62c9\u53d6JIRA\u7684bug\u5355\u5f55\u5165\u5230Multica\u7684Issue"},"content":{"rendered":"\n<p>\u53ef\u4ee5\u5b9e\u73b0JIRA\u5f55\u5165Bug\u5355\u540e\uff0cMultica\u81ea\u52a8\u63a5\u5355\u5e76\u4e14\u81ea\u52a8\u4fee\u590d\u4e0a\u4f20\u5230\u5206\u652f<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u521b\u5efaJIRA\u8bbf\u95ee\u4ee4\u724c<\/h1>\n\n\n\n<p>\u8fdb\u5165JIRA\uff0c\u70b9\u7528\u6237\u4fe1\u606f\uff0c\u4e2a\u4eba\u8bbf\u95ee\u4ee4\u7248\uff0c\u521b\u5efa\u4ee4\u724c\uff0c\u4fdd\u5b58\u597d<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u521b\u5efa\u62c9\u53d6\u811a\u672c<\/h1>\n\n\n\n<p>getJiraTask.py<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\nimport json\nimport os\n\nJIRA_HOST = \"http:\/\/jira.<strong>\u516c\u53f8\u57df\u540d<\/strong>.com:<strong>\u7aef\u53e3\u53f7<\/strong>\"\nPAT_TOKEN = \"NTU2Njk2MDY0ODkzOoKHXqTwoFE1jrEZOTpV45ZaHAfw\"\nQ_ASSIGNEE = \"AND assignee in (<strong>\u7528\u6237\u540d<\/strong>,<strong>\u7528\u6237\u540d<\/strong>...)\"\nQ_STATUS = \"AND status = \u7b49\u5f85\u5904\u7406 AND resolution = Unresolved\"\nQ_CREATED = \"AND created &gt;= -48h\"\nJQL = f\"project=KTP {Q_CREATED} {Q_STATUS} {Q_ASSIGNEE}\"\nURL = f\"{JIRA_HOST}\/rest\/api\/2\/search\"\nHEADERS = { \"Authorization\": f\"Bearer {PAT_TOKEN}\", \"Content-Type\": \"application\/json\" }\nPARAMS = {\"jql\": JQL, \"maxResults\": 100, \"startAt\": 0 }\n\ndef loadLocalTaskKeys():\n    try:\n        with open(\"task_key.txt\", \"r\") as f:\n            return &#91;line.strip() for line in f if line.strip()]\n    except FileNotFoundError:\n        return &#91;]\n\ndef getJiraTasks():\n    if os.path.exists(\"task_new.json\"):\n        os.remove(\"task_new.json\")\n    taskKeys = loadLocalTaskKeys()\n    response = requests.get(URL, headers=HEADERS, params=PARAMS)\n    if response.status_code == 200:\n        data = response.json()\n        newTasks = &#91;]\n        for issue in data&#91;\"issues\"]:\n            key = issue&#91;\"key\"]\n            if key in taskKeys:\n                continue\n            summary = issue&#91;\"fields\"]&#91;\"summary\"]\n            lowSummary = summary.lower()\n            if \"bot\" in lowSummary:\n                description = issue&#91;\"fields\"]&#91;\"description\"]\n                assignee = issue&#91;\"fields\"]&#91;\"assignee\"]&#91;\"name\"]\n                newTasks.append({\"key\": key, \"summary\": summary, \"description\": description, \"assignee\": assignee})\n        if newTasks:\n            with open(\"task_new.json\", \"w\", encoding=\"utf-8\") as f:\n                json.dump(newTasks, f, ensure_ascii=False, indent=2)\n\ngetJiraTasks()\n<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u811a\u672c\u62c9\u53d6\u8fd12\u5929\u7684JIRA\u4efb\u52a1\u5355\uff0c\u5e76\u4e14\u5224\u65ad<\/p>\n\n\n\n<p>1\u3001\u6807\u9898\u662f\u5426\u6709bot\uff0c\u6ca1\u6709\u5219\u4e0d\u521b\u5efa<\/p>\n\n\n\n<p>2\u3001\u9632\u6b62\u91cd\u590d\u521b\u5efa<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Multica\u6dfb\u52a0Skill\uff1aget_client_jira_task<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5de5\u4f5c\u76ee\u5f55\n\u9650\u5b9a\u5728xx\u76ee\u5f55\u4e2d\n\n# \u751f\u6210\u65b0\u4efb\u52a1\n* \u8fd0\u884cgetJiraTasks.py\uff0c\u5c06\u4f1a\u751f\u6210task_new.json\u6587\u4ef6\n* \u82e5\u6ca1\u6709\u751f\u6210task_new.json\u6587\u4ef6\uff0c\u4efb\u52a1\u4e2d\u6b62\n\n# \u8f6c\u6362\u4e3aMultica issue\n* task_new.json\u7684\u683c\u5f0f\u4e3a\u4e00\u7ec4issue\u4fe1\u606f\uff0c\u5355\u4e2aissue\u4fe1\u606f\u542b\u6709key,summary,description\uff0cissue\u7684title=key+summary\n* \u5355\u4e2aissue\u4fe1\u606f\uff0c\u8f6c\u6362\u4e3aMultica\u7684issue\uff0c\u9879\u76ee\u4e3axxx\uff0c\u5206\u914d\u7ed9bot_develop\u6267\u884c\uff0c\u5e76\u5c06key\u8ffd\u52a0\u5230task_key.txt\u4e2d<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u6dfb\u52a0\u5b9a\u65f6\u5668<\/h1>\n\n\n\n<p>\u6bcf\u969430\u5206\u949f\u81ea\u52a8\u8fd0\u884cskill get_client_jira_task<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">bot_develop\u667a\u80fd\u4f53\u914d\u7f6e<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>```md\n## \u4f60\u662f\u8c01\n\u4f60\u662fxxx,\u4e3b\u8981\u4f7f\u7528xxx\u8bed\u8a00\n\n## \u4f60\u7684git\u5de5\u4f5c\u533a\nxxxx\n\u4e0d\u5f97\u5207\u6362git\u5206\u652f\n\n## \u4ee3\u7801\u76ee\u5f55\nxxxx\n\n## \u7f16\u8f91\u4e0e\u63d0\u4ea4\n- \u4fee\u6539\u524d\uff0c\u5148\u66f4\u65b0git\n- \u7f16\u8f91\u5b8c\u6210\u76f4\u63a5commit\u548cpush\n- commit\u63d0\u4ea4\u4fe1\u606f\u4e0eissue\u6807\u9898\u4e00\u81f4\n```<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u4ee5\u5b9e\u73b0JIRA\u5f55\u5165Bug\u5355\u540e\uff0cMultica\u81ea\u52a8\u63a5\u5355\u5e76\u4e14\u81ea\u52a8\u4fee\u590d\u4e0a\u4f20\u5230\u5206\u652f \u521b\u5efaJIRA\u8bbf\u95ee\u4ee4\u724c \u8fdb\u5165JIR [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/6458"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6458"}],"version-history":[{"count":4,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/6458\/revisions"}],"predecessor-version":[{"id":6463,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/6458\/revisions\/6463"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}