{"id":17933,"date":"2023-01-06T00:18:40","date_gmt":"2023-01-06T00:18:40","guid":{"rendered":"https:\/\/44.225.35.201\/testrail\/docs\/801\/server-guide\/customizations-and-extensions\/building-a-custom-defect-plugin\/"},"modified":"2023-09-12T11:03:25","modified_gmt":"2023-09-12T02:03:25","slug":"building-custom-plugin","status":"publish","type":"page","link":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/server-guide\/customizations-and-extensions\/building-custom-plugin\/","title":{"rendered":"\u30ab\u30b9\u30bf\u30e0\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4f5c\u6210"},"content":{"rendered":"<p>TestRail \u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001TestRail \u3092\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30d0\u30b0\u304a\u3088\u3073\u8ab2\u984c\u8ffd\u8de1\u30c4\u30fc\u30eb\u3068\u7d71\u5408\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002TestRail \u306b\u306f\u3001\u591a\u304f\u306e\u4e00\u822c\u7684\u306a\u30c4\u30fc\u30eb\u3068\u306e\u7d71\u5408\u306b\u3059\u3050\u306b\u4f7f\u3048\u308b\u30d7\u30e9\u30b0\u30a4\u30f3 \u30b9\u30af\u30ea\u30d7\u30c8\u304c\u4ed8\u5c5e\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001TestRail \u306b\u4ed8\u5c5e\u3057\u3066\u3044\u308b\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u6a19\u6e96\u7684\u306a\u69cb\u6210\u306e\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30cb\u30fc\u30ba\u306b\u5408\u308f\u305b\u3066\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u304c\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3055\u308c\u3066\u3044\u308b\u5834\u5408 (\u305f\u3068\u3048\u3070\u3001\u65b0\u3057\u3044\u5fc5\u9808\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u306a\u3069)\u3001\u307e\u305f\u306f\u7d71\u5408\u306e\u52d5\u4f5c\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u3082\u3001\u65b0\u3057\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u308a\u3001\u65b0\u3057\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3057\u305f\u308a\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u306b\u5fc5\u9808\u30ab\u30b9\u30bf\u30e0 \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u3089\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092 [<strong>\u6b20\u9665\u306e\u30d7\u30c3\u30b7\u30e5<\/strong>] \u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u3002<\/li>\n<li>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u632f\u308b\u821e\u3044\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408 (\u305f\u3068\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc \u30de\u30c3\u30d4\u30f3\u30b0\u3092\u8ffd\u52a0\u3057\u305f\u308a\u3001\u9001\u4fe1\u3055\u308c\u308b\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u306b\u60c5\u5831\u3092\u8ffd\u52a0\u3059\u308b\u306a\u3069)\u3002<\/li>\n<li>\u30ab\u30b9\u30bf\u30e0 \u30c4\u30fc\u30eb\/\u307e\u3060\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u30c4\u30fc\u30eb\u3068\u7d71\u5408\u3057\u305f\u3044\u5834\u5408\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u57fa\u672c\u7684\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3068\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306e\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u307e\u305f\u3001 [\u6b20\u9665\u306e\u30d7\u30c3\u30b7\u30e5] \u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u65b0\u3057\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u3001\u304a\u3088\u3073\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u30e6\u30fc\u30b6\u30fc \u30de\u30c3\u30d4\u30f3\u30b0\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u306e\u5177\u4f53\u7684\u306a<a href=\"\/example-custom-plugin\" target=\"_blank\" rel=\"noopener\">\u30b5\u30f3\u30d7\u30eb<\/a>\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"callout callout--info\">\n<p>[et_pb_text admin_label=&#8221;Note&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#F0F8FF&#8221; hover_enabled=&#8221;0&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#b0c4de&#8221;]<\/p>\n<p>\u72ec\u81ea\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3057\u305f\u3082\u306e\u3092\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u3068\u5171\u6709\u3057\u305f\u3044\u5834\u5408\u3001\u30d1\u30d6\u30ea\u30c3\u30af\u306a <a href=\"https:\/\/github.com\/gurock\/testrail-custom\/tree\/master\/user-submitted\/defect-plugins\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>TestRail \u30ab\u30b9\u30bf\u30de\u30a4\u30ba GitHub \u30ea\u30dd\u30b8\u30c8\u30ea<\/strong><\/a>\u306b\u30b3\u30f3\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u3057\u3066\u3044\u305f\u3060\u3051\u307e\u3059\u3002<\/p>\n<p>[\/et_pb_text]<\/p>\n<h2><span style=\"color: revert; font-size: revert; font-weight: revert;\">\u306f\u3058\u3081\u306b<\/span><\/h2>\n<\/div>\n<p>[et_pb_text admin_label=&#8221;Note&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#ffffdd&#8221; hover_enabled=&#8221;0&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#E1E163&#8243;]<\/p>\n<p>\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f PHP \u3067\u958b\u767a\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u72ec\u81ea\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u307e\u305f\u306f\u4f5c\u6210\u3059\u308b\u5834\u5408\u3001PHP \u306b\u3064\u3044\u3066\u306e\u57fa\u672c\u7684\u306a\u77e5\u8b58\u304c\u5fc5\u8981\u3067\u3059\u3002\u30ab\u30b9\u30bf\u30e0\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u3064\u3044\u3066\u306f\u3001\u4f5c\u6210\u3055\u308c\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\u306e\u8abf\u67fb\u3084\u89e3\u6c7a\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002PHP\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u88c5\u7d4c\u9a13\u306e\u3042\u308b\u65b9\u306e\u652f\u63f4\u3092\u304a\u9858\u3044\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[\/et_pb_text]<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u521d\u671f\u5316\u6642\u306b TestRail \u304c\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63a2\u3059\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f 2 \u3064\u3042\u308a\u307e\u3059\u3002\u6700\u521d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u3001TestRail \u7d44\u307f\u8fbc\u307f\u306e\u30c7\u30d5\u30a9\u30eb\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u3082\u4fdd\u5b58\u3055\u308c\u308b\u5834\u6240\u3067\u3059\u3002TestRail \u3092\u66f4\u65b0\u3059\u308b\u3068\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4e0a\u66f8\u304d\u3055\u308c\u308b\u305f\u3081\u3001\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d7\u30e9\u30b0\u30a4\u30f3 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u307e\u305f\u306f\u5909\u66f4\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;TestRail&gt;\/app\/plugins\/defects<\/pre>\n<p>\u5909\u66f4\u307e\u305f\u306f\u65b0\u898f\u8ffd\u52a0\u3055\u308c\u305f\u30d7\u30e9\u30b0\u30a4\u30f3 \u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u5e38\u306b\u30ab\u30b9\u30bf\u30e0\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;TestRail&gt;\/custom\/defects<\/pre>\n<h2>\u30d7\u30e9\u30b0\u30a4\u30f3 \u30d5\u30a1\u30a4\u30eb<\/h2>\n<p>\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 TestRail \u304c\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u3068\u306e\u901a\u4fe1\u306b\u4f7f\u7528\u3059\u308b\u30af\u30e9\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u5358\u7d14\u306a PHP \u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u308a\u72ec\u81ea\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u3001\u4e0a\u8a18\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089\u30ab\u30b9\u30bf\u30e0\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u65e2\u5b58\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30b3\u30d4\u30fc\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u5909\u66f4\u3057\u3066\u5229\u7528\u3067\u304d\u307e\u3059\u3002\u3042\u308b\u3044\u306f\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8 \u30b9\u30b1\u30eb\u30c8\u30f3\u304b\u3089\u59cb\u3081\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001TestRail \u306e Jira \u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3044\u5834\u5408\u306f\u3001<strong>&lt;TestRail&gt;\/app\/plugins\/defects<\/strong> \u304b\u3089 <strong>&lt;TestRail&gt;\/custom\/defects<\/strong> \u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002TestRail \u306f\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u610f\u306e (\u30af\u30e9\u30b9) \u8b58\u5225\u5b50\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u00a0<strong> Jira_ExampleInc.php<\/strong>\u00a0\u306b\u5909\u66f4\u3057\u3066\u3001\u7d44\u7e54\u306e\u540d\u524d\u307e\u305f\u306f TestRail \u3068\u7d71\u5408\u3057\u305f\u3044\u30ab\u30b9\u30bf\u30e0 \u30c4\u30fc\u30eb\u306e\u540d\u524d\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u4e00\u81f4\u3059\u308b\u3088\u3046\u306b\u6b20\u9665\u30af\u30e9\u30b9\u540d\u3092\u8abf\u6574\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u57fa\u672c<\/h2>\n<p>\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 TestRail \u304c\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u3068\u306e\u901a\u4fe1\u306b\u4f7f\u7528\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3057\u305f\u5358\u7d14\u306a PHP \u30af\u30e9\u30b9\u3067\u3059\u3002TestRail \u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4e00\u610f\u306e\u8b58\u5225\u5b50\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002\u30d7\u30e9\u30b0\u30a4\u30f3 \u30af\u30e9\u30b9\u540d\u306f\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u57fa\u3065\u3044\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u30d7\u30e9\u30b0\u30a4\u30f3 \u30b9\u30af\u30ea\u30d7\u30c8 \u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u304c Jira.php \u3067\u3042\u308b\u5834\u5408\u3001\u30d7\u30e9\u30b0\u30a4\u30f3 \u30af\u30e9\u30b9\u540d\u306f <strong>Jira_defect_plugin<\/strong> \u3068\u3044\u3046\u540d\u524d\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3059\u3079\u3066\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3 \u30af\u30e9\u30b9\u306f TestRail \u306e\u00a0 <strong>Defect_plugin<\/strong> \u57fa\u5e95\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u30af\u30e9\u30b9 \u30b9\u30b1\u30eb\u30c8\u30f3\u306f\u3001\u3059\u3079\u3066\u306e\u57fa\u5e95\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3057\u3001\u57fa\u672c\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u3068\u5f15\u6570\u3092\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">\/\/ MyPlugin.php\nclass MyPlugin_defect_plugin extends Defect_plugin\n{\n  \/\/ Get Meta\n  \/\/\n  \/\/ Expected to return meta data for this plugin such as Author,\n  \/\/ Version, Description and supported plugin capabilities.\n  public function get_meta()\n  {\n  }\n \n  \/\/ Validate Config\n  \/\/\n  \/\/ Validates the plugin configuration that is entered in the site\n  \/\/ or project settings. Expected to throw a ValidationException\n  \/\/ in case the passed configuration does not validate.\n  public function validate_config($config)\n  {\n  }\n \n  \/\/ Configure\n  \/\/\n  \/\/ Passes the configuration for the plugin as specified in the\n  \/\/ site or project settings (as string).\n  public function configure($config)\n  {\n  }\n \n  \/\/ Prepare Push\n  \/\/\n  \/\/ Signals if the plugin requires\/supports a form to submit the\n  \/\/ defect. Returns 'false' to signal that no form is required.\n  \/\/ Otherwise the plugin should return the form description that\n  \/\/ is used to render the form and display it to the user.\n  public function prepare_push($context)\n  {\n  }\n \n  \/\/ Prepare Field\n  \/\/\n  \/\/ Called for each field of the push form to gather the field\n  \/\/ data for the form. The plugin can return default values or\n  \/\/ available options for the field (in case of a dropdown\n  \/\/ box, for example), among other values.\n  public function prepare_field($context, $input, $field)\n  {\n  }\n \n  \/\/ Validate Push\n  \/\/\n  \/\/ Called before the actual push attempt is processed (in case\n  \/\/ the plugin uses a custom form). Useful for adding custom\n  \/\/ validation functionality for the form that is not covered by\n  \/\/ TestRail itself. Expected to throw a ValidationException in\n  \/\/ case the passed input of the custom form does not validate.\n  public function validate_push($context, $input)\n  {\n  }\n \n  \/\/ Push\n  \/\/\n  \/\/ Executes the actual push request by adding a new case to the\n  \/\/ defect tracker. Expected to return the new defect ID (as\n  \/\/ string or integer).\n  public function push($context, $input)\n  {\n  }\n \n  \/\/ Lookup\n  \/\/\n  \/\/ Looks up the defect\/issue\/case with the given ID and returns\n  \/\/ its properties as key\/value array. The following return values\n  \/\/ are required:\n  \/\/ \n  \/\/ id:           The ID of the defect (usually the same as the\n  \/\/               passed ID)\n  \/\/ title:        The title\/summary of the defect\n  \/\/ status_id:    The status ID of the defect. Possible values\n  \/\/               are:\n  \/\/               - GI_DEFECTS_STATUS_OPEN\n  \/\/               - GI_DEFECTS_STATUS_RESOLVED\n  \/\/               - GI_DEFECTS_STATUS_CLOSED\n  \/\/ status:       The status as text\n  \/\/ \t             \n  \/\/\n  \/\/ The following properties are optional:\n  \/\/\n  \/\/ url:          The full HTTP url to view the defect\n  \/\/ description:  The description of the defect (supports HTML,\n  \/\/               the plugin is responsible for providing well-\n  \/\/               formed and valid HTML and must escape data\n  \/\/               that is not expected to be rendered as HTML).\n  \/\/ attributes:   A key\/value list of additional attributes.\n  \/\/               The value also supports HTML with the same\n  \/\/               implications as for the description.\n  public function lookup($defect_id)\n  {\n  }\n}<\/pre>\n<p>\u305f\u3060\u3057\u3001\u5fc5\u305a\u3057\u3082\u3059\u3079\u3066\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b8c\u5168\u306b\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u306f (\u73fe\u5728\u306e\u3068\u3053\u308d) 2 \u3064\u306e\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002\u6b20\u9665\u3092\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3068\u6b20\u9665\u60c5\u5831\u3092\u691c\u7d22\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u4f5c\u6210\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3084\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u3088\u3063\u3066\u306f\u3001\u3053\u308c\u3089\u306e\u6a5f\u80fd\u306e\u3046\u3061\u306e 1 \u3064\u3060\u3051\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u7406\u306b\u304b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u30c6\u30b9\u30bf\u30fc\u304c [\u6b20\u9665\u306e\u30d7\u30c3\u30b7\u30e5] \u30c0\u30a4\u30a2\u30ed\u30b0\u304b\u3089\u96fb\u5b50\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\u3001\u691c\u7d22\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u540c\u69d8\u306b\u3001\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u304b\u3089\u6b20\u9665\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u304c\u3001\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8 \u30d5\u30a9\u30fc\u30e0\u306f\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u306e\u3082\u306e\u3092\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30d7\u30c3\u30b7\u30e5\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u975e\u5e38\u306b\u67d4\u8edf\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u73fe\u5728 TestRail \u306b\u4ed8\u5c5e\u3057\u3066\u3044\u308b\u3059\u3079\u3066\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u30c6\u30b9\u30bf\u30fc\u304c\u5165\u529b\u6e08\u307f\u306e\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u308b\u3088\u3046\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3057\u307e\u3059\u304c\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u8868\u793a\u306f\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u4ecb\u5165\u306a\u3057\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u81ea\u52d5\u7684\u306b\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u9001\u4fe1\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u72ec\u81ea\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u69cb\u7bc9\u3059\u308b<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3059\u308b\u624b\u9806\u3092\u8a73\u3057\u304f\u8aac\u660e\u3057\u3001\u3055\u307e\u3056\u307e\u306a\u30d7\u30e9\u30b0\u30a4\u30f3 \u30e1\u30bd\u30c3\u30c9\u3068\u7279\u5fb4\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u72ec\u81ea\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4e00\u304b\u3089\u4f5c\u6210\u3059\u308b\u4e88\u5b9a\u306f\u306a\u304f\u3001\u5358\u306b\u65e2\u5b58\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3044\u5834\u5408\u3082\u3001\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u306f\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5185\u90e8\u306e\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u5b66\u3076\u305f\u3081\u306e\u6700\u826f\u306e\u65b9\u6cd5\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u67b6\u7a7a\u306e\u30d0\u30b0\u8ffd\u8de1\u30c4\u30fc\u30eb Bugs \u7528\u306e\u65b0\u3057\u3044\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4ee5\u964d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u65b0\u3057\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3059\u308b\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4f5c\u6210\u3092\u59cb\u3081\u308b\u524d\u306b\u3001TestRail \u306f\u3059\u3079\u3066\u306e\u6587\u5b57\u5217\u3068\u30c6\u30ad\u30b9\u30c8\u304c UTF-8 \u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u3042\u308b\u3068\u671f\u5f85\u3059\u308b (\u305d\u3057\u3066 TestRail \u304c\u63d0\u4f9b\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u3082 UTF-8 \u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u3042\u308b) \u3053\u3068\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3064\u307e\u308a\u3001TestRail \u306b\u8fd4\u5374\u3059\u308b (\u307e\u305f\u306f TestRail \u304b\u3089\u53d7\u3051\u53d6\u308b) \u3059\u3079\u3066\u306e\u6587\u5b57\u5217\u3068\u30c6\u30ad\u30b9\u30c8\u306f UTF-8 \u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u6b27\u7c73\u4ee5\u5916\u306e\u6587\u5b57\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u7279\u306b\u91cd\u8981\u3067\u3059\u304c\u3001ASCII \u4ee5\u5916\u306e\u7279\u6b8a\u6587\u5b57\u306a\u3069\u3082\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/h2>\n<p>\u65b0\u3057\u3044\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u6210\u3059\u308b\u969b\u306e\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8 \u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3092 <strong>Bug.php<\/strong> \u3068\u3057\u3001TestRail \u306e\u30ab\u30b9\u30bf\u30e0 \u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea <strong>(&lt;TestRail&gt;\/custom\/defects)<\/strong> \u306b\u914d\u7f6e\u3057\u307e\u3059\u3002\u65e2\u5b58\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5229\u7528\u3059\u308b\u5834\u5408 (\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3059\u3079\u3066\u5b8c\u5168\u306a\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<strong>&lt;TestRail&gt;\/app\/plugins\/defects<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308a\u307e\u3059)\u3001\u305d\u308c\u3092\u30ab\u30b9\u30bf\u30e0\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3057\u3066\u540d\u524d\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002Bugs\u306e\u57fa\u672c\u7684\u306a\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059 (<strong>&lt;?php<\/strong> \u30bf\u30b0\u3092\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u3067\u9589\u3058\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30d5\u30a1\u30a4\u30eb\u672b\u5c3e\u306e\u7a7a\u306e\u884c\u306b\u3088\u3063\u3066 PHP \u306e\u30d8\u30c3\u30c0\u30fc\u51fa\u529b\u304c\u58ca\u308c\u308b\u306e\u3092\u9632\u304e\u307e\u3059)\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">class Bugs_defect_plugin extends Defect_plugin\n{\n}<\/pre>\n<h2>\u30e1\u30bf \u30c7\u30fc\u30bf\u3092\u8fd4\u3059<\/h2>\n<p>\u6700\u521d\u306b\u5b9f\u88c5\u3059\u308b\u306e\u306f <strong>get_meta<\/strong> \u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u4f5c\u6210\u8005\u306e\u540d\u524d\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3001\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u6a5f\u80fd\u3001\u8a2d\u5b9a\u306e\u8a73\u7d30\u306a\u3069\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092 TestRail \u306b\u901a\u77e5\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u6b21\u306e\u3088\u3046\u306b\u3001\u60c5\u5831\u3092\u542b\u3080\u914d\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">{\n  return array(\n    'author' =&gt; 'Example Inc.',\n    'version' =&gt; '1.0',\n    'description' =&gt; 'Bugs defect plugin for TestRail',\n    'can_push' =&gt; false,\n    'can_lookup' =&gt; false,\n    'default_config' =&gt; \n      \"; Please configure your Bugs connection below\\n\" .\n      \"[connection]\\n\" .\n      \"address=http:\/\/\/\\n\" .\n      \"user=testrail\\n\" .\n      \"password=secret\"\n  );\n}<\/pre>\n<p>\u7279\u306b\u91cd\u8981\u306a\u306e\u306f <strong>can_push<\/strong> \u304a\u3088\u3073 <strong>can_lookup<\/strong> \u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3069\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u304b\u3092 TestRail \u306b\u4f1d\u3048\u307e\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f<em>\u30d7\u30c3\u30b7\u30e5<\/em>\u6a5f\u80fd\u3068<em>\u691c\u7d22<\/em>\u6a5f\u80fd\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4eca\u5f8c\u306e TestRail \u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u65b0\u3057\u3044\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>default_config <\/strong>\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u3082\u6ce8\u76ee\u3059\u3079\u304d\u3067\u3059\u3002\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 <strong>[\u7ba1\u7406] &gt; [\u7d71\u5408]<\/strong> \u306e\u4e0b\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u3001\u307e\u305f\u306f<strong> [\u7ba1\u7406] &gt; [\u30d7\u30ed\u30b8\u30a7\u30af\u30c8]<\/strong> \u306e\u4e0b\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002\u7ba1\u7406\u8005\u304c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u304d\u3001<strong>default_config<\/strong> \u3067\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u304c\u8a2d\u5b9a\u30c6\u30ad\u30b9\u30c8 \u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u8a2d\u5b9a<\/h2>\n<p>\u901a\u5e38\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u306f\u6b20\u9665\u8ffd\u8de1\u30b7\u30b9\u30c6\u30e0\u306e\u30a2\u30c9\u30ec\u30b9\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u304a\u3088\u3073\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u7ba1\u7406\u8005\u304c TestRail \u3067\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\u969b\u3001\u30c6\u30ad\u30b9\u30c8 \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4f7f\u7528\u3057\u3066\u8a2d\u5b9a\u3092\u5165\u529b\u3057\u307e\u3059\u3002\u30c6\u30ad\u30b9\u30c8 \u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u3055\u307e\u3056\u307e\u306a\u8868\u8a18\u6cd5 (INI \u30aa\u30d7\u30b7\u30e7\u30f3\u3001XML \u306a\u3069) \u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u72ec\u81ea\u306e\u8a2d\u5b9a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>TestRail \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u8a2d\u5b9a\u306b INI \u30d5\u30a1\u30a4\u30eb\u8868\u8a18\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001<strong>[sections]<\/strong> \u3068 <strong>name=value<\/strong> \u30da\u30a2\u3092\u4f7f\u7528\u3057\u3066\u8a2d\u5b9a\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002TestRail \u306f INI \u8868\u8a18\u3055\u308c\u305f\u8a2d\u5b9a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8aad\u307f\u53d6\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5099\u3048\u3066\u3044\u308b\u305f\u3081\u3001\u901a\u5e38\u306f INI \u8868\u8a18\u3092\u4f7f\u3046\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u7ba1\u7406\u8005\u304c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u3001TestRail \u306f\u5165\u529b\u3055\u308c\u305f\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3088\u3046\u306b\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u8981\u6c42\u3057\u307e\u3059\u3002TestRail \u306f\u5fc5\u8981\u306a\u8a2d\u5b9a (\u3042\u308b\u3044\u306f\u8a2d\u5b9a\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u3048) \u306b\u3064\u3044\u3066\u306e\u60c5\u5831\u3092\u6301\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u3059\u3079\u3066\u306e\u5fc5\u8981\u306a\u8a2d\u5b9a\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u691c\u8a3c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001TestRail \u306f\u7ba1\u7406\u8005\u304c\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u3088\u3046\u3068\u3059\u308b\u305f\u3073\u306b validate_config \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function validate_config($config)\n{\n  $ini = ini::parse($config);\n \n  \/\/ Check if the [connection] section exists\n  if (!isset($ini['connection']))\n  {\n    throw new ValidationException('Missing [connection] group');\n  }\n \n  \/\/ Check if the required values exist\n  $keys = array('address', 'user', 'password');\n  foreach ($keys as $key)\n  {\n    if (!isset($ini['connection'][$key]) ||\n      !$ini['connection'][$key])\n    {\n      throw new ValidationException(\n        \"Missing configuration for key '$key'\"\n      );\n    }\n  }\n \n  $address = $ini['connection']['address'];\n \n  \/\/ Check whether the address is a valid url (syntax only)\n  if (!check::url($address))\n  {\n    throw new ValidationException('Address is not a valid url');\n  }\n}<\/pre>\n<p>\u4e0a\u8a18\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001<strong>[connection]<\/strong> \u30bb\u30af\u30b7\u30e7\u30f3\u304c\u5b58\u5728\u3057\u3001\u30bb\u30af\u30b7\u30e7\u30f3\u306b <strong>address<\/strong> \u3001<strong>user<\/strong>\u3001\u304a\u3088\u3073 <strong>password<\/strong> \u30ad\u30fc\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u307e\u305f\u3001password \u30ad\u30fc\u306b\u6709\u52b9\u306a URL \u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u3092 ( <strong>check::url<\/strong>\u00a0 \u30eb\u30fc\u30c1\u30f3\u3092\u4f7f\u7528\u3057\u3066) \u78ba\u8a8d\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30e1\u30bd\u30c3\u30c9\u306e\u5192\u982d\u3067 TestRail \u306e <strong>ini<\/strong> \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u8a2d\u5b9a\u3092\u89e3\u6790\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u3082\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30e1\u30bd\u30c3\u30c9\u304c\u8a2d\u5b9a\u306e\u554f\u984c (\u30ad\u30fc\u306e\u6b20\u843d\u3001\u7121\u52b9\u306a\u5024\u306a\u3069) \u3092\u691c\u51fa\u3057\u305f\u5834\u5408 <strong>ValidationException<\/strong> \u578b\u306e\u4f8b\u5916\u3092\u4e0a\u3052\u307e\u3059\u3002\u3059\u308b\u3068\u3001TestRail \u304c\u7ba1\u7406\u8005\u306b\u30a8\u30e9\u30fc \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u8a2d\u5b9a\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u6cd5\u304c\u5fc5\u8981\u3067\u3059\u3002TestRail \u306f\u3001\u6b20\u9665\u30af\u30e9\u30b9\u304c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3055\u308c\u308b\u305f\u3073\u306b\u81ea\u52d5\u7684\u306b <strong>configure<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001TestRail \u306f\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u6b20\u9665 ID \u306e\u691c\u7d22\u3092\u4f9d\u983c\u3059\u308b\u524d\u306b <strong>configure<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u8a2d\u5b9a\u3092\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u63d0\u4f9b\u3057\u307e\u3059\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u3067\u3042\u308b\u9593\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u3092\u4fdd\u6301\u3057\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u3068\u304d\u306b\u8a2d\u5b9a\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u901a\u5e38\u3001\u8a2d\u5b9a\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function configure($config)\n{\n  $ini = ini::parse($config);\n  $this-&gt;_address = str::slash($ini['connection']['address']);\n  $this-&gt;_user = $ini['connection']['user'];\n  $this-&gt;_password = $ini['connection']['password'];\t\n}<\/pre>\n<p>\u30e1\u30bd\u30c3\u30c9\u306f <strong>ini<\/strong> \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4ecb\u3057\u3066\u8a2d\u5b9a\u3092\u518d\u5ea6\u89e3\u6790\u3057\u3001\u8a2d\u5b9a\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\/\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u305d\u306e\u5f8c\u306e\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u3067\u6b20\u9665\u8ffd\u8de1\u30b7\u30b9\u30c6\u30e0\u306e\u30a2\u30c9\u30ec\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001 <strong>$this\u2192_address<\/strong> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h2>\u6b20\u9665\u3092\u691c\u7d22\u3059\u308b<\/h2>\n<p>\u307e\u305a\u3001\u6b20\u9665\u691c\u7d22\u6a5f\u80fd\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u3053\u306e\u6a5f\u80fd\u306f\u3001\u6b20\u9665\u30d7\u30c3\u30b7\u30e5\u6a5f\u80fd\u3088\u308a\u3082\u5b9f\u88c5\u304c\u7c21\u5358\u3067\u3042\u308b\u305f\u3081\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u304b\u3092\u3088\u308a\u3088\u304f\u7406\u89e3\u3059\u308b\u306e\u306b\u9069\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002TestRail \u304c\u5165\u529b\u3055\u308c\u305f\u6b20\u9665 ID \u3092 (\u305f\u3068\u3048\u3070\u30c6\u30b9\u30c8\u7d50\u679c\u306e\u4e00\u90e8\u3068\u3057\u3066) \u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3068\u304d\u3001\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u6b20\u9665\u306e\u691c\u7d22\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059 ( <strong>get_meta<\/strong> \u306b\u3088\u3063\u3066\u8fd4\u3055\u308c\u308b <strong>can_lookup<\/strong> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066)\u3002<\/p>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u691c\u7d22\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30de\u30a6\u30b9 \u30ab\u30fc\u30bd\u30eb\u3092\u6b20\u9665 ID \u306e\u4e0a\u306b\u79fb\u52d5\u3059\u308b\u3068\u3001\u6b20\u9665\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3068\u8aac\u660e\u306e\u8a73\u7d30\u3092\u53c2\u7167\u3067\u304d\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u3053\u306e\u64cd\u4f5c\u3092\u5b9f\u884c\u3059\u308b\u305f\u3073\u306b\u3001\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u3001TestRail \u306f \u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u6b20\u9665\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u8981\u6c42\u3057\u307e\u3059 (\u53c2\u8003\u307e\u3067\u306b\u3001\u4eca\u5f8c\u3001\u30ec\u30dd\u30fc\u30c8\u7528\u306b\u30aa\u30fc\u30d7\u30f3\u4e2d\/\u30af\u30ed\u30fc\u30ba\u6e08\u307f\u306e\u6b20\u9665\u3092\u8a08\u7b97\u3059\u308b\u306a\u3069\u3001\u4ed6\u306e\u76ee\u7684\u3067\u3053\u306e\u60c5\u5831\u304c\u4f7f\u7528\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059)\u3002<\/p>\n<p>\u6b20\u9665\u60c5\u5831\u306e\u8981\u6c42\u306f\u3001<strong>lookup<\/strong> \u30e1\u30bd\u30c3\u30c9\u306b\u3088\u3063\u3066\u884c\u308f\u308c\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u308b\u524d\u306b\u3001TestRail \u306f\u5e38\u306b<strong> configure<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u5fc5\u8981\u306a\u8a2d\u5b9a\u304c\u3059\u3079\u3066\u5b58\u5728\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u67b6\u7a7a\u306e\u6b20\u9665\u8ffd\u8de1\u30b7\u30b9\u30c6\u30e0 <em>Bugs<\/em> \u306e<strong> lookup<\/strong> \u30e1\u30bd\u30c3\u30c9\u306f\u3001\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function lookup($defect_id)\n{\n  \/\/ Get the defect information via the Bugs API\n  $defect = $this-&gt;_bugs_get_defect($defect_id);\n \n  \/\/ Build the status_id based on the status property\n  if ($defect['status'] == 'Open')\n  {\n    $status_id = GI_DEFECTS_STATUS_OPEN;\n  }\n  elseif ($defect['status'] == 'Resolved')\n  {\n    $status_id = GI_DEFECTS_STATUS_RESOLVED;\n  }\n  else\n  {\n    $status_id = GI_DEFECTS_STATUS_CLOSED;\n  }\n \n  \/\/ Build the bug URL and project link\n  $bug_url = str::format('{0}?bug={1}', \n    $this-&gt;_address,\n    $defect['id']);\n  $project_link = str::format(\n    '{2}',\n    a($this-&gt;_address),\n    a($defect['project_id']),\n    h($defect['project']));\n \n  \/\/ Build the description\n  $description = str::format(\n    '{0}',\n    nl2br(\n      html::link_urls(\n        h($defect['description'])\n      )\n    )\n  );\t\n \n  \/\/ Return the defect details\n  return array(\n    'id' =&gt; $defect['id'],\n    'title' =&gt; $defect['title'],\n    'status_id' =&gt; $status_id,\n    'status' =&gt; $defect['status'],\n    'url' =&gt; $bug_url,\n    'description' =&gt; $description,\n    'attributes' =&gt; array(\n      'Type' =&gt; h($defect['type']),\n      'Status' =&gt; h($defect['status']),\n      'Project' =&gt; $project_link\n    )\n  );\n}<\/pre>\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u308c\u307e\u3067\u898b\u3066\u304d\u305f\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u5b9f\u88c5\u3088\u308a\u3082\u5c11\u3057\u9577\u3044\u306e\u3067\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u5b9f\u884c\u3059\u308b\u30b9\u30c6\u30c3\u30d7\u3092\u500b\u5225\u306b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u307e\u305a\u3001internal\/private <strong>_bugs_get_defect<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u6b20\u9665\u306e\u8a73\u7d30\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9 (\u307e\u305f\u306f\u985e\u4f3c\u306e\u30e1\u30bd\u30c3\u30c9) \u306f\u901a\u5e38\u3001\u6b20\u9665\u8ffd\u8de1\u30b7\u30b9\u30c6\u30e0\u306e API \u3092\u547c\u3073\u51fa\u3059\u304b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6b20\u9665\u60c5\u5831\u3092\u691c\u7d22\u3057\u307e\u3059\u3002\u3053\u306e\u30b5\u30f3\u30d7\u30eb \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30bd\u30fc\u30b9 \u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u5358\u306b\u3059\u3079\u3066\u306e\u6b20\u9665\u306e\u8a73\u7d30\u3092\u30cf\u30fc\u30c9\u30b3\u30fc\u30c9\u3057\u3066\u304a\u308a\u3001\u5b9f\u969b\u306b\u306f Web \u30b5\u30fc\u30d3\u30b9\u306e\u547c\u3073\u51fa\u3057\u3092\u884c\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u306b\u6c17\u4ed8\u304f\u3067\u3057\u3087\u3046\u304c\u3001\u30c7\u30e2\u76ee\u7684\u3067\u306f\u3053\u308c\u3067\u3058\u3085\u3046\u3076\u3093\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u5f8c\u3001TestRail \u306b\u8fd4\u3059 <strong>status_id<\/strong> \u3084\u30ea\u30f3\u30af\u3001\u8aac\u660e\u306a\u3069\u306e\u5024\u3092\u6e96\u5099\u3057\u307e\u3059\u3002 <strong>status_id<\/strong> \u00a0\u306f\u3001\u6b20\u9665\u304c open \u3067\u3042\u308b\u304b resolved \u3067\u3042\u308b\u304b\u3001\u307e\u305f\u306f closed \u3067\u3042\u308b\u304b\u3092 TestRail \u306b\u4f1d\u3048\u307e\u3059\u3002\u30d0\u30b0 \u30c8\u30e9\u30c3\u30ab\u30fc\u304c resolved \u3068 closed \u3092\u533a\u5225\u3057\u306a\u3044\u5834\u5408 (\u30d0\u30b0\u306f opened \u304b resolved \u306e\u3069\u3061\u3089\u304b\u3067\u3042\u308b\u5834\u5408\u306a\u3069)\u3001 <strong>GI_DEFECTS_STATUS_CLOSED<\/strong> \u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002TestRail \u306f\u3001\u4eca\u5f8c\u3001\u30ec\u30dd\u30fc\u30c8\u304a\u3088\u3073\u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u3067<strong> status_id<\/strong> \u3092\u4f7f\u7528\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>lookup<\/strong> \u30e1\u30bd\u30c3\u30c9\u304c\u8fd4\u3059\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u3044\u304f\u3064\u304b\u306f HTML \u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001TestRail \u306b\u8fd4\u3059\u524d\u306b\u6587\u5b57\u5217\u3084\u5024\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3042\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059 (\u30d0\u30b0 \u30c8\u30e9\u30c3\u30ab\u30fc\u304c\u8fd4\u3059\u5024\u304c\u6709\u52b9\u306a HTML \u30c7\u30fc\u30bf\u3067\u306f\u306a\u3044\u5834\u5408)\u3002\u30a8\u30b9\u30b1\u30fc\u30d7\u3092\u884c\u308f\u306a\u3044\u3068\u3001\u30af\u30ed\u30b9 \u30b5\u30a4\u30c8 \u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0 (XSS) \u653b\u6483\u306e\u5371\u967a\u6027\u304c\u3042\u308a\u3001\u6f5c\u5728\u7684\u306a\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30ea\u30b9\u30af\u3068\u306a\u308a\u307e\u3059\u3002\u6587\u5b57\u5217\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u306b\u306f\u3001TestRail \u304c\u63d0\u4f9b\u3059\u308b<strong> h()<\/strong> \u00a0\u304a\u3088\u3073 <strong>a()<\/strong> \u30eb\u30fc\u30c1\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u30c6\u30ad\u30b9\u30c8\u3068\u30bf\u30b0\u5c5e\u6027\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u8fd4\u3055\u308c\u308b\u5c5e\u6027\u306b HTML \u30b3\u30fc\u30c9 (\u30ea\u30f3\u30af\u306a\u3069) \u304c\u542b\u307e\u308c\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306a\u3069\u306e\u5024\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u306a\u3044\u3068\u3001TestRail \u306f\u305d\u308c\u3089\u3092\u305d\u306e\u307e\u307e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u305f\u3081\u3001\u653b\u6483\u8005\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3092\u4ecb\u3057\u3066 JavaScript \u30b3\u30fc\u30c9\u3092\u633f\u5165\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u00a0 div \u30bf\u30b0\u3067\u30d0\u30b0\u306e\u8aac\u660e\u3092\u30e9\u30c3\u30d7\u3057\u3001\u8aac\u660e\u3092\u7b49\u5e45\u30d5\u30a9\u30f3\u30c8\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u3082\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u91cd\u8981\u306a\u51e6\u7406\u3068\u3057\u3066\u3001\u30e1\u30bd\u30c3\u30c9\u306f TestRail \u306b\u6b20\u9665\u306e\u8a73\u7d30\u3092\u8fd4\u3057\u307e\u3059\u3002\u6b20\u9665 ID\u3001\u30bf\u30a4\u30c8\u30eb\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u306a\u3069\u306e\u60c5\u5831\u306e\u307b\u304b\u306b\u3001\u5c5e\u6027\u3068\u8aac\u660e\u3092\u8fd4\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u5c5e\u6027\u306b\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3001\u8ab2\u984c\u30bf\u30a4\u30d7\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3001\u307e\u305f\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9818\u57df\u306a\u3069\u306e\u60c5\u5831\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5c5e\u6027\u3068\u540c\u3058\u3088\u3046\u306b\u3001\u8aac\u660e\u306f HTML \u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u3069\u3093\u306a\u7a2e\u985e\u306e\u60c5\u5831\u3092\u8ffd\u52a0\u3059\u308b\u306e\u306b\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002HTML \u30bf\u30b0\u304c\u58ca\u308c\u3066\u3044\u308b\u3068\u3001TestRail \u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u3084\u6a5f\u80fd\u304c\u58ca\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u8fd4\u3055\u308c\u305f\u3059\u3079\u3066\u306e HTML \u306b\u542b\u307e\u308c\u308b\u30bf\u30b0\u3084\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304c\u6709\u52b9\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u6b21\u306e\u30b9\u30af\u30ea\u30fc\u30f3 \u30b7\u30e7\u30c3\u30c8\u306f\u3001\u8fd4\u3055\u308c\u305f\u6b20\u9665\u306e\u60c5\u5831\u3092 TestRail \u304c\u3069\u306e\u3088\u3046\u306b\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u304b\u3092\u793a\u3057\u3066\u3044\u307e\u3059 (\u8aac\u660e\u306e\u4e0a\u90e8\u306b\u9752\u3044\u80cc\u666f\u3067\u5c5e\u6027\u304c\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044)\u3002<\/p>\n<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/lookup-defects.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/lookup-defects.png\" alt=\"\" width=\"550\" height=\"274\" class=\"aligncenter size-full wp-image-9099\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/lookup-defects.png 550w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/lookup-defects-480x239.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 550px, 100vw\" \/><\/a><\/p>\n<h2>\u30c0\u30a4\u30a2\u30ed\u30b0\u306a\u3057\u3067\u6b20\u9665\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b<\/h2>\n<p>\u6b21\u306b\u3001TestRail \u304b\u3089\u6b20\u9665\u30ec\u30dd\u30fc\u30c8\u3092\u6b20\u9665\u8ffd\u8de1\u30c4\u30fc\u30eb\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u6700\u521d\u306b\u30d7\u30c3\u30b7\u30e5 \u30c0\u30a4\u30a2\u30ed\u30b0\u306a\u3057\u3067\u30d7\u30c3\u30b7\u30e5\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3001\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u30d7\u30c3\u30b7\u30e5 \u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f7f\u3063\u305f\u3088\u308a\u8907\u96d1\u306a\u30b7\u30ca\u30ea\u30aa\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002\u30d7\u30c3\u30b7\u30e5 \u30c0\u30a4\u30a2\u30ed\u30b0\u306a\u3057\u3067\u30d7\u30c3\u30b7\u30e5\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\u30012 \u3064\u306e \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<strong>prepare_push<\/strong> \u3068 <strong>push<\/strong> \u3067\u3059\u3002TestRail \u306f<strong> prepare_push<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u304a\u3088\u3073\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u8981\u6c42\u3057\u307e\u3059\u3002\u30d7\u30c3\u30b7\u30e5 \u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5fc5\u8981\u3068\u305b\u305a\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u64cd\u4f5c\u306a\u3057\u3067\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u30d7\u30c3\u30b7\u30e5\u3057\u305f\u3044\u3060\u3051\u306e\u5834\u5408\u306f\u3001\u5358\u306b false \u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function prepare_push($context)\n{\n  return false;\n}<\/pre>\n<p>\u5b9f\u969b\u306b\u6b20\u9665\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u305f\u3081\u306b\u3001push \u30e1\u30bd\u30c3\u30c9\u3082\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6709\u7528\u306a\u6b20\u9665\u30ec\u30dd\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u3082\u3061\u308d\u3093\u30c6\u30b9\u30c8\u306b\u95a2\u3059\u308b\u60c5\u5831 (\u30b1\u30fc\u30b9\u306e\u30bf\u30a4\u30c8\u30eb\u3084\u5165\u529b\u3055\u308c\u305f\u30b3\u30e1\u30f3\u30c8\u306a\u3069) \u304c\u5fc5\u8981\u3067\u3059\u3057\u3001\u6b20\u9665\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u306a\u3069\u3001\u305d\u306e\u4ed6\u306e\u60c5\u5831\u304c\u5fc5\u8981\u306a\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002\u305d\u3053\u3067\u3001\u30d7\u30c3\u30b7\u30e5\u95a2\u9023\u306e\u3059\u3079\u3066\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u308b<strong> $context<\/strong> \u5f15\u6570\u3092\u5229\u7528\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002<strong> $context<\/strong> \u5f15\u6570\u306b\u306f\u3001\u30c6\u30b9\u30c8 \u30b1\u30fc\u30b9\u306b\u95a2\u3059\u308b\u8a73\u7d30\u3001\u30c6\u30b9\u30c8\u3001\u6b20\u9665\u3092\u30d7\u30c3\u30b7\u30e5\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306a\u3069\u3001\u591a\u304f\u306e\u6709\u7528\u306a\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<strong> $context<\/strong> \u5f15\u6570\u3092\u4ecb\u3057\u3066\u6e21\u3055\u308c\u308b\u60c5\u5831\u3092\u3044\u304f\u3064\u304b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">Array\n(\n    [event] =&gt; push\n    [tests] =&gt; Array\n        (\n            [0] =&gt; stdClass Object\n                (\n                    [id] =&gt; 12\n                    [run_id] =&gt; 1\n                    [case_id] =&gt; 128\n                    [status_id] =&gt; 1\n                    [url] =&gt; http:\/\/testrail\/index.php?\/tests\/view\/12\n                    [case] =&gt; stdClass Object\n                        (\n                            [id] =&gt; 128\n                            [title] =&gt; Verify CSV import with enclosed test data files\n                            [url] =&gt; http:\/\/testrail\/index.php?\/cases\/view\/128\n                        )\n\n                    [run] =&gt; stdClass Object\n                        (\n                            [id] =&gt; 1\n                            [name] =&gt; File Formats\n                            [config] =&gt; \n                            [plan_id] =&gt; \n                            [project_id] =&gt; 1\n                            [url] =&gt; http:\/\/testrail\/index.php?\/runs\/view\/1\n                        )\n\n                )\n\n        )\n\n    [test_count] =&gt; 1\n    [test_change] =&gt; stdClass Object\n        (\n            [status_id] =&gt; 1\n            [assignedto] =&gt; \n            [comment] =&gt; Importing our standard Unicode CSV file (unitest1.csv) failed with the error message `Could not detect file encoding`.\n            [attachments] =&gt; \n            [version] =&gt; \n            [elapsed] =&gt; \n            [defects] =&gt; \n        )\n\n    [project] =&gt; stdClass Object\n        (\n            [id] =&gt; 1\n            [name] =&gt; Datahub\n            [url] =&gt; http:\/\/testrail\/index.php?\/projects\/overview\/1\n        )\n\n    [preferences] =&gt; Array\n        (\n            [type] =&gt; 1\n            [project] =&gt; DH\n            [component] =&gt; 10010\n        )\n\n    [user] =&gt; stdClass Object\n        (\n            [id] =&gt; 2\n            [name] =&gt; ..\n            [email] =&gt; test@example.com\n        )\n\n)<\/pre>\n<p>\u3054\u89a7\u306e\u3068\u304a\u308a\u3001TestRail \u306f\u9078\u629e\u3057\u305f\u30c6\u30b9\u30c8\u3001\u95a2\u9023\u3059\u308b\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3001\u30c6\u30b9\u30c8\u306e\u5909\u66f4 (\u30e6\u30fc\u30b6\u30fc\u304c [<strong>\u7d50\u679c\u306e\u8ffd\u52a0<\/strong>] \u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u5165\u529b\u3057\u305f\u60c5\u5831) \u306a\u3069\u306b\u95a2\u3059\u308b\u8a73\u7d30\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u69cb\u9020\u304b\u3089\u308f\u304b\u308b\u3088\u3046\u306b\u3001TestRail \u304c\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u8907\u6570\u306e\u30c6\u30b9\u30c8\u3092\u6e21\u3059\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u8907\u6570\u306e\u30c6\u30b9\u30c8\u3092\u9078\u629e\u3057\u3001[<strong>\u7d50\u679c\u306e\u8ffd\u52a0<\/strong>] \u30dc\u30bf\u30f3\u3092\u4f7f\u7528\u3057\u3066\u305d\u308c\u3089\u306e\u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8\u306b\u4e00\u5ea6\u306b\u7d50\u679c\u3092\u8ffd\u52a0\u3057\u305f\u5834\u5408\u3001TestRail \u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u8907\u6570\u306e\u30c6\u30b9\u30c8 \u30ec\u30b3\u30fc\u30c9\u3092\u6e21\u3057\u307e\u3059\u3002\u6b20\u9665\u3092\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u65b0\u3057\u3044\u6b20\u9665 ID \u3092\u8fd4\u3059\u51e6\u7406\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function push($context, $input)\n{\n  \/\/ Build the summary\/title\n  $test = current($context['tests']);\n  $summary = 'Failed test: ' . $test-&gt;case-&gt;title;\n \n  if ($context['test_count'] &gt; 1)\n  {\n    $summary .= ' (+others)';\n  }\t\n \n  \/\/ Build the comment (based on the test result comment\n  \/\/ and links\/URLs of the tests\n  if ($context['test_change']-&gt;comment)\n  {\n    $comment = $context['test_change']-&gt;comment;\n    $comment .= \"\\n\";\n  }\n  else \n  {\n    $comment = '';\n  }\n \n  $tests = $context['tests'];\n  foreach ($tests as $test)\n  {\n    $comment .= \"\\nTest: \";\n    $comment .= $test-&gt;case-&gt;title;\n    $comment .= \"\\n\";\n    $comment .= $test-&gt;url;\n  }\n \n  \/\/ We hard code a few other details here for demonstration\n  \/\/ purposes. We could also select these attributes based\n  \/\/ on context information such as the test suite or user\n  $project = $context['project']-&gt;name;\n  $type = 'Bug';\n  $component = '(default)';\n \n  \/\/ Push the defect and return the new defect ID\n  $defect_id = $this-&gt;_bugs_push_defect(\n    $summary,\n    $comment,\n    $project,\n    $type,\n    $component\n  );\n  return $defect_id;\n}<\/pre>\n<p><span style=\"font-size: 14px; color: #666666; font-family: 'Open Sans', Arial, sans-serif;\"><strong>push<\/strong> \u30e1\u30bd\u30c3\u30c9\u306f\u3001\u5165\u529b\u3055\u308c\u305f\u30c6\u30b9\u30c8\u7d50\u679c\u3068\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u306e\u30bf\u30a4\u30c8\u30eb\/\u8981\u7d04\u3068\u30b3\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u5185\u90e8\u306e <strong>_bugs_push_defect<\/strong> <\/span><span style=\"font-size: 14px; color: #666666; font-family: 'Open Sans', Arial, sans-serif;\">\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u5b9f\u969b\u306e\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001Web \u30b5\u30fc\u30d3\u30b9 API \u306e\u547c\u3073\u51fa\u3057\u307e\u305f\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u306e\u66f8\u304d\u8fbc\u307f\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002\u65b0\u3057\u3044\u6b20\u9665\u306e ID \u3092TestRail \u306b\u8fd4\u3059\u3068\u3001TestRail \u304c\u81ea\u52d5\u7684\u306b<\/span><em style=\"font-size: 14px; color: #666666; font-family: 'Open Sans', Arial, sans-serif;\">\u6b20\u9665<\/em><span style=\"font-size: 14px; color: #666666; font-family: 'Open Sans', Arial, sans-serif;\">\u30d5\u30a3\u30fc\u30eb\u30c9\u306b ID \u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/span><\/p>\n<h2>\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f7f\u7528\u3057\u3066\u6b20\u9665\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b<\/h2>\n<p>\u30e6\u30fc\u30b6\u30fc\u306e\u64cd\u4f5c\u306a\u3057\u3067\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u69cb\u7bc9\u3092\u898b\u3066\u304d\u305f\u306e\u3067\u3001\u6b21\u306b [<strong>\u6b20\u9665\u306e\u30d7\u30c3\u30b7\u30e5<\/strong>] \u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002\u30c6\u30b9\u30bf\u30fc\u306f\u3001\u6b20\u9665\u3092\u6b20\u9665\u8ffd\u8de1\u30b7\u30b9\u30c6\u30e0\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u969b\u3001\u3053\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f7f\u7528\u3057\u3066\u6b20\u9665\u306e\u8aac\u660e\u3092\u5909\u66f4\u3057\u305f\u308a\u3001\u5225\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u3002\u6700\u521d\u306b<strong> prepare_push<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u5909\u66f4\u3057\u307e\u3059\u3002\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u4e0d\u8981\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3059 <strong>false<\/strong>\u00a0\u3092\u8fd4\u3059\u4ee3\u308f\u308a\u306b\u3001\u6b21\u306e\u3088\u3046\u306a\u30d5\u30a9\u30fc\u30e0 \u30b9\u30ad\u30fc\u30de\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function prepare_push($context)\n{\n  \/\/ Return a form with the following fields\/properties\n  return array(\n    'fields' =&gt; array(\n      'summary' =&gt; array(\n        'type' =&gt; 'string',\n        'label' =&gt; 'Summary',\n        'required' =&gt; true,\n        'size' =&gt; 'full'\n      ),\n      'type' =&gt; array(\n        'type' =&gt; 'dropdown',\n        'label' =&gt; 'Issue Type',\n        'required' =&gt; true,\n        'remember' =&gt; true,\n        'size' =&gt; 'compact'\n      ),\n      'project' =&gt; array(\n        'type' =&gt; 'dropdown',\n        'label' =&gt; 'Project',\n        'required' =&gt; true,\n        'remember' =&gt; true,\n        'cascading' =&gt; true,\n        'size' =&gt; 'compact'\n      ),\n      'component' =&gt; array(\n        'type' =&gt; 'dropdown',\n        'label' =&gt; 'Component',\n        'required' =&gt; true,\n        'remember' =&gt; true,\n        'depends_on' =&gt; 'project',\n        'size' =&gt; 'compact'\n      ),\n      'description' =&gt; array(\n        'type' =&gt; 'text',\n        'label' =&gt; 'Description'\n      )\n    )\n  );\n}<\/pre>\n<p>\u30d5\u30a9\u30fc\u30e0 \u30b9\u30ad\u30fc\u30de\u306f\u3001\u5fc5\u8981\u306a\u30d5\u30a9\u30fc\u30e0 \u30d5\u30a3\u30fc\u30eb\u30c9\u3092 TestRail \u306b\u6307\u793a\u3057\u307e\u3059\u3002prepare_push \u30e1\u30bd\u30c3\u30c9\u3067\u8fd4\u3057\u305f\u30d5\u30a9\u30fc\u30e0 \u30b9\u30ad\u30fc\u30de\u306b\u57fa\u3065\u3044\u3066 TestRail \u304c\u81ea\u52d5\u7684\u306b\u30d7\u30c3\u30b7\u30e5 \u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u305f\u3081\u3001\u6b20\u9665\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u30c0\u30a4\u30a2\u30ed\u30b0\u81ea\u4f53\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4e0a\u8a18\u306e\u4f8b\u3067\u8fd4\u3055\u308c\u308b\u30d5\u30a9\u30fc\u30e0 \u30b9\u30ad\u30fc\u30de\u306e\u5927\u90e8\u5206\u306f\u3001\u8aac\u660e\u304c\u306a\u304f\u3068\u3082\u308f\u304b\u308b\u3067\u3057\u3087\u3046\u3002TestRail \u304c\u8868\u793a\u3059\u308b\u30d5\u30a9\u30fc\u30e0 \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u914d\u5217\u30ad\u30fc (\u4f8b\u3048\u3070 \u2018description\u2019) \u306f\u3001TestRail \u304c\u5165\u529b\u30c7\u30fc\u30bf\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u6e21\u3059\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u540d\u524d\u3067\u3059\u3002\u30d5\u30a3\u30fc\u30eb\u30c9\u306e <em>type<\/em> \u306f\u3001\u73fe\u5728\u3001 <strong>text<\/strong> \u3001<strong>dropdown<\/strong> \u307e\u305f\u306f <strong>string<\/strong> \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5fc5\u8981\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30bf\u30a4\u30d7\u3092 TestRail\u306b\u4f1d\u3048\u307e\u3059\u3002<strong>string<\/strong> \u00a0\u306f\u5358\u4e00\u884c\u306e\u30c6\u30ad\u30b9\u30c8\u5165\u529b\u8981\u7d20\u3067\u3042\u308a\u3001<strong>text<\/strong> \u306f\u8907\u6570\u306e\u5165\u529b\u884c\u3092\u53d7\u3051\u5165\u308c\u307e\u3059 \u3002<em>required<\/em> \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u3088\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5165\u529b\u304c\u5fc5\u9808\u304b\u307e\u305f\u306f\u4efb\u610f\u304b\u3092\u6307\u5b9a\u3057\u3001 <em>label<\/em> \u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u5185\u3067\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u8868\u793a\u65b9\u6cd5\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><em>size<\/em> \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6a2a\u5e45\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<strong>full<\/strong> \u304c\u6307\u5b9a\u3055\u308c\u305f\u5834\u5408\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u6a2a\u5e45\u3044\u3063\u3071\u3044\u306e\u5927\u304d\u3055\u306b\u306a\u308a\u307e\u3059\u3002\u30d5\u30a3\u30fc\u30eb\u30c9 \u30b5\u30a4\u30ba\u3068\u3057\u3066 <strong>compact<\/strong> \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001TestRail \u306f\u540c\u3058\u884c\u306b\u8907\u6570\u306e\u5c0f\u3055\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8868\u793a\u3057\u3088\u3046\u3068\u3057\u307e\u3059 (\u3053\u308c\u306f\u3001\u30d5\u30a9\u30fc\u30e0 \u30b9\u30ad\u30fc\u30de\u3067\u3072\u3068\u307e\u3068\u307e\u308a\u3067\u6307\u5b9a\u3055\u308c\u305f\u5c0f\u3055\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u306e\u307f\u9069\u7528\u3055\u308c\u307e\u3059)\u3002<em>remember<\/em> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001TestRail \u306f\u73fe\u5728\u306e TestRail \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u6700\u5f8c\u306b\u5165\u529b\u3055\u308c\u305f\u5024\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4ee5\u524d\u306b\u5165\u529b\u3057\u305f\u30d5\u30a9\u30fc\u30e0\u5024 (\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9818\u57df\u3084\u30b5\u30d6 \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306a\u3069) \u3092\u7c21\u5358\u306b\u4fdd\u5b58\u3067\u304d\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u540c\u3058\u30c7\u30fc\u30bf\u3092\u4f55\u5ea6\u3082\u5165\u529b\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u5f8c\u534a\u3067\u3001\u3053\u308c\u304c\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u306e\u304b\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u4ed6\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u4f9d\u5b58\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001[<strong>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/strong>] \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3 \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308b\u5834\u5408\u3001\u95a2\u9023\u3059\u308b [<strong>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9818\u57df<\/strong>] \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u306f\u3001\u9078\u629e\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002TestRail \u306f\u3001\u3053\u306e\u3088\u3046\u306a\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306b\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u5225\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u3001TestRail \u306f\u65b0\u3057\u304f\u9078\u629e\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u6709\u52b9\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9818\u57df\u3092\u6b20\u9665\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u8981\u6c42\u3057\u3001[<strong>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u9818\u57df<\/strong>] \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u30af\u30ea\u30a2\u3057\u307e\u3059\u3002\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u4f9d\u5b58\u95a2\u4fc2\u306f <strong>depends_on<\/strong> \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u6307\u5b9a\u3055\u308c\u3001\u73fe\u5728\u306f\u3001\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3 \u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u306e\u307f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4ed6\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u4f9d\u5b58\u3067\u304d\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092 <strong>cascading<\/strong> \u3068\u3057\u3066\u30de\u30fc\u30af\u3059\u308b (\u305d\u308c\u305e\u308c\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066) \u3053\u3068\u3082\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u30d5\u30a9\u30fc\u30e0 \u30b9\u30ad\u30fc\u30de\u3092\u6307\u5b9a\u3057\u305f\u306e\u3067\u3001\u4eca\u5ea6\u306f\u6709\u52b9\u306a\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u5024\u3068\u30c0\u30a4\u30a2\u30ed\u30b0 \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8 \u30c6\u30ad\u30b9\u30c8\u3092 TestRail \u306b\u6307\u793a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f <strong>prepare_field<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u4ecb\u3057\u3066\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002TestRail \u304c\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u521d\u671f\u5316\u3059\u308b\u3068\u304d\u3001\u307e\u305f\u306f\u30ab\u30b9\u30b1\u30fc\u30c9 \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u304d\u3001TestRail \u306f\u95a2\u9023\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u63d0\u4f9b\u3059\u308b\u3088\u3046\u306b\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u4f9d\u983c\u3057\u307e\u3059\u3002TestRail\u306f\u3001\u60c5\u5831\u3092\u5fc5\u8981\u3068\u3059\u308b\u3059\u3079\u3066\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u3057\u3066 <strong>prepare_filed<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function prepare_field($context, $input, $field)\n{\n  $data = array();\n \n  \/\/ Take the preferences of the user into account, but only\n  \/\/ for the initial form rendering (not for cascading loads).\n  if ($context['event'] == 'prepare')\n  {\n    $prefs = arr::get($context, 'preferences');\n  }\n  else\n  {\n    $prefs = null;\n  }\n \n  \/\/ And then build the options and default values for the\n  \/\/ form fields and return them.\n  switch ($field)\n  {\n    case 'summary':\n      $data['default'] = \n        $this-&gt;_get_summary_default($context);\n      break;\n \n    case 'description':\n      $data['default'] = \n        $this-&gt;_get_description_default($context);\n      break;\n \n    case 'type':\n      $data['options'] = $this-&gt;_bugs_get_types();\n \n      \/\/ Select the stored preference or the first item in\n      \/\/ the list otherwise.\n      $default = arr::get($prefs, 'type');\n      if ($default)\n      {\n        $data['default'] = $default;\n      }\n      else\n      {\n        if ($data['options'])\n        {\n          $data['default'] = key($data['options']);\n        }\n      }\t\t\t\t\n      break;\n \n    case 'project':\n      $data['default'] = arr::get($prefs, 'project');\n      $data['options'] = $this-&gt;_bugs_get_projects();\n      break;\n \n    case 'component':\n      if (isset($input['project']))\n      {\n        $data['default'] = arr::get($prefs, 'component');\n        $data['options'] = $this-&gt;_bugs_get_components(\n          $input['project']);\n      }\n      break;\n  }\n \n  return $data;\n}<\/pre>\n<p>TestRail \u306f <strong>prepare_field<\/strong> \u30e1\u30bd\u30c3\u30c9\u306b 3 \u3064\u306e\u5f15\u6570\u3092\u6e21\u3057\u307e\u3059\u3002 <strong>$context<\/strong> \u5f15\u6570\u306b\u306f\u3001\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u5f15\u304d\u7d99\u3044\u3060\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<strong>$input<\/strong> \u914d\u5217\u306b\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30d7\u30c3\u30b7\u30e5 \u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u5165\u529b\u3057\u305f\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059 (\u3053\u308c\u306f\u30ab\u30b9\u30b1\u30fc\u30c9 \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u547c\u3073\u51fa\u3057\u6642\u306b\u7279\u306b\u5f79\u7acb\u3061\u307e\u3059)\u3002<strong>$field<\/strong> \u5f15\u6570\u306b\u306f\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u540d\u524d\u304c\u542b\u307e\u308c\u307e\u3059 (\u30e1\u30bd\u30c3\u30c9\u306f\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u3057\u3066\u500b\u5225\u306b\u547c\u3073\u51fa\u3055\u308c\u307e\u3059)\u3002<\/p>\n<p>TestRail \u306f<strong> $context<\/strong> \u5f15\u6570\u306e\u4e00\u90e8\u3068\u3057\u3066 (\u73fe\u5728\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3059\u308b) \u73fe\u5728\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u8a2d\u5b9a\u3082\u6e21\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001TestRail \u304c\u73fe\u5728\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u521d\u671f\u5316\u3057\u3066\u3044\u308b\u5834\u5408\u3001<strong>prepare_field<\/strong> \u30e1\u30bd\u30c3\u30c9\u304c\u6700\u521d\u306b\u884c\u3046\u51e6\u7406\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u3092\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3059\u3067\u306b\u521d\u671f\u5316\u3055\u308c\u305f\u5f8c\u3001\u30ab\u30b9\u30b1\u30fc\u30c9 \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3 \u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u3059\u308b\u547c\u3073\u51fa\u3057\u3067\u3042\u308b\u5834\u5408\u306f\u3001\u8a2d\u5b9a\u3092\u7121\u8996\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u5f8c\u3001TestRail \u306b\u30d5\u30a3\u30fc\u30eb\u30c9\u7528\u306e\u9069\u5207\u306a\u30c7\u30fc\u30bf\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001\u9577\u3044 switch \u6587\u3067\u3053\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002TestRail \u304c\u30c7\u30fc\u30bf\u3092\u8981\u6c42\u3057\u3066\u3044\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5fdc\u3058\u3066\u3001\u95a2\u9023\u3059\u308b\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001TestRail \u304c <strong>Project<\/strong> \u30d5\u30a3\u30fc\u30eb\u30c9\u7528\u306e\u5024\u3092\u8981\u6c42\u3057\u305f\u5834\u5408\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">case 'project':\n  $data['default'] = arr::get($prefs, 'project');\n  $data['options'] = $this-&gt;_bugs_get_projects();\n  break;<\/pre>\n<p>\u57fa\u672c\u7684\u306b\u3001TestRail \u306f\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3 \u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u95a2\u3057\u3066 2 \u3064\u306e\u60c5\u5831\u3092\u5fc5\u8981\u3068\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u9078\u629e\u53ef\u80fd\u306a options \u3068\u9078\u629e\u3055\u308c\u3066\u3044\u308b default \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002\u30c6\u30ad\u30b9\u30c8 \u30d5\u30a3\u30fc\u30eb\u30c9\u304a\u3088\u3073\u6587\u5b57\u5217\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u306f\u3001<em>default<\/em> \u5024\u3060\u3051\u3092\u6307\u5b9a\u3057\u307e\u3059 (\u30c6\u30ad\u30b9\u30c8 \u30d5\u30a3\u30fc\u30eb\u30c9\u307e\u305f\u306f\u6587\u5b57\u5217\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u9078\u629e\u53ef\u80fd\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u306a\u3044\u304b\u3089\u3067\u3059)\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a\u306b\u57fa\u3065\u3044\u3066 default \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u9078\u629e\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u4ee5\u524d\u306b\u7279\u5b9a\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u306f\u3001\u305d\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5fa9\u5143\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u518d\u5ea6\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u540c\u69d8\u306b\u3001\u30c6\u30b9\u30c8\u306e\u8a73\u7d30\u306b\u57fa\u3065\u3044\u3066\u3001\u8981\u7d04\/\u30bf\u30a4\u30c8\u30eb\u3068\u8aac\u660e\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/push-defect.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/push-defect.png\" alt=\"\" width=\"502\" height=\"346\" class=\"aligncenter size-full wp-image-9089\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/push-defect.png 502w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-content\/uploads\/push-defect-480x331.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 502px, 100vw\" \/><\/a><\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001<strong>_bugs_get_projects<\/strong> \u306a\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b8c\u5168\u306b\u306f\u5b9f\u88c5\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u5b8c\u5168\u306b\u6a5f\u80fd\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u306f\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u6b20\u9665\u30c8\u30e9\u30c3\u30ab\u30fc\u306e Web \u30b5\u30fc\u30d3\u30b9 API \u3092\u4f7f\u3063\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308b\u3067\u3057\u3087\u3046 (\u3042\u308b\u3044\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30ea\u30b9\u30c8\u3092\u8aad\u307f\u53d6\u308b\u3067\u3057\u3087\u3046)\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001\u5358\u306b\u30cf\u30fc\u30c9\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3057\u307e\u3059 (\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u983b\u7e41\u306b\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u5834\u5408\u3001\u3053\u308c\u3082\u6709\u52b9\u306a\u5b9f\u88c5\u65b9\u6cd5\u306b\u306a\u308a\u5f97\u307e\u3059)\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">private function _bugs_get_projects()\n{\n  return array(\n    'dh' =&gt; 'Datahub',\n    'pr' =&gt; 'Presenter',\n    'wr' =&gt; 'Writer'\n  );\n}<\/pre>\n<p>\u3053\u3053\u3067\u306f\u3001\u914d\u5217\u30ad\u30fc\u3068\u3057\u3066 ID \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001TestRail \u306f\u3053\u308c\u3089\u306e ID \u3092\u5165\u529b\u5024\u3068\u3057\u3066 push \u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3057\u307e\u3059\u3002push \u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u524d\u306b\u3001<strong>validate_push<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u7c21\u5358\u306b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308a\u3001\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u306b\u5165\u529b\u3055\u308c\u305f\u5024\u3092\u53d7\u3051\u5165\u308c\u308b\u524d\u306b\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u691c\u8a3c\u3067\u304d\u307e\u3059\u3002\u30c7\u30fc\u30bf\u3092\u691c\u8a3c\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u5834\u5408\u306f\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u7279\u5b9a\u306e\u5165\u529b\u5f62\u5f0f\u3084\u5236\u7d04 (\u65e5\u4ed8\u306a\u3069) \u3092\u5f37\u5236\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u6b21\u306e\u4f8b\u3067\u306f\u3001<strong>validate_push<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u8981\u7d04\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6587\u5b57\u6570\u3092 100 \u6587\u5b57\u307e\u3067\u306b\u5236\u9650\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function validate_push($context, $input) \n{ \n  if (isset($input['summary'])) \n  { \n    if (str::len($input['summary']) &gt; 100) \n    { \n      throw new ValidationException( 'Field Summary cannot exceed 100 characters.'); \n    } \n  } \n}<\/pre>\n<p>\u30e6\u30fc\u30b6\u30fc\u304c\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u5165\u529b\u3057\u3066\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u304c<strong> validate_push<\/strong> \u30e1\u30bd\u30c3\u30c9\u306b\u3088\u3063\u3066\u5165\u529b\u3092\u691c\u8a3c\u3057\u305f\u3089\u3001TestRail \u306f <strong>push <\/strong>\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u306a\u3057\u306e\u4f8b\u3068\u540c\u69d8\u306b\u3001 <strong>push<\/strong> \u30e1\u30bd\u30c3\u30c9\u306f\u30ec\u30dd\u30fc\u30c8\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u3001<strong>$context<\/strong> \u5f15\u6570\u304b\u3089\u30d0\u30b0 \u30ec\u30dd\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001<strong>$input<\/strong> \u5f15\u6570\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function push($context, $input)\n{\n  \/\/ Push the defect and return the new defect ID\n  $defect_id = $this-&gt;_bugs_push_defect(\n    $input['summary'],\n    $input['description'],\n    $input['project'],\n    $input['type'],\n    $input['component']\n  );\n  return $defect_id;\n}<\/pre>\n<p>\u3053\u308c\u3067\u7d42\u308f\u308a\u3067\u3059\u3002\u3053\u308c\u3067\u3001\u691c\u7d22\u6a5f\u80fd\u3068\u30d7\u30c3\u30b7\u30e5\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3001TestRail \u5185\u304b\u3089\u7ba1\u7406\u8005\u304c\u8a2d\u5b9a\u3067\u304d\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30ea\u30b9\u30c8\u306e\u30ab\u30b9\u30b1\u30fc\u30c9 \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u5168\u4f53\u3092\u6b63\u3057\u304f\u5b9f\u88c5\u3067\u304d\u307e\u3057\u305f\u3002\u4e0b\u8a18\u306e\u5b8c\u5168\u306a\u30b5\u30f3\u30d7\u30eb \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u307b\u304b\u3001\u305d\u306e\u4ed6\u306e\u30b5\u30f3\u30d7\u30eb \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u8aac\u660e\u3057\u305f\u30b5\u30f3\u30d7\u30eb \u30b9\u30af\u30ea\u30d7\u30c8\u5168\u4f53\u306f\u3001\u3053\u3053\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"callout callout--success\">\n<p class=\"callout__title\"><em class=\"fas fa-download\">\u00a0<\/em> <a href=\"\/wp-content\/uploads\/bugs.zip\">Bugs.php \u30b5\u30f3\u30d7\u30eb<\/a><\/p>\n<\/div>\n<p>\u5b9f\u969b\u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4ed6\u306e\u4f8b\u3092\u898b\u308b\u306b\u306f\u3001TestRail \u306b\u540c\u68b1\u3055\u308c\u3066\u3044\u308b\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u898b\u3066\u307f\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f TestRail \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e<strong> app\/plugins\/defects<\/strong> \u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TestRail \u306e\u6b20\u9665\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001TestRail \u3092\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30d0\u30b0\u304a\u3088\u3073\u8ab2\u984c\u8ffd\u8de1\u30c4\u30fc\u30eb\u3068\u7d71\u5408\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002TestRail \u306b\u306f\u3001\u591a\u304f\u306e\u4e00\u822c\u7684\u306a\u30c4\u30fc\u30eb\u3068\u306e\u7d71\u5408\u306b\u3059\u3050\u306b\u4f7f\u3048\u308b\u30d7\u30e9\u30b0\u30a4\u30f3 \u30b9\u30af\u30ea\u30d7\u30c8\u304c\u4ed8\u5c5e\u3057 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":6643,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-17933","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/17933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/comments?post=17933"}],"version-history":[{"count":71,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/17933\/revisions"}],"predecessor-version":[{"id":23506,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/17933\/revisions\/23506"}],"up":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/pages\/6643"}],"wp:attachment":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/9\/wp-json\/wp\/v2\/media?parent=17933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}