{"id":17828,"date":"2023-01-05T08:21:48","date_gmt":"2023-01-05T08:21:48","guid":{"rendered":"https:\/\/44.225.35.201\/testrail\/docs\/801\/server-guide\/customizations-and-extensions\/custom-report-plugins\/reports-building-a-custom-report-plugin-2-3\/"},"modified":"2023-09-12T13:42:14","modified_gmt":"2023-09-12T04:42:14","slug":"custom-report-2","status":"publish","type":"page","link":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/server-guide\/customizations-and-extensions\/custom-report-plugins\/custom-report-2\/","title":{"rendered":"\u30ab\u30b9\u30bf\u30e0 \u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4f5c\u6210 (2\/3)"},"content":{"rendered":"<p>\u901a\u5e38\u3001\u30ec\u30dd\u30fc\u30c8 \u30d5\u30a9\u30fc\u30e0\u306f 2 \u3064\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u5206\u304b\u308c\u3066\u3044\u307e\u3059\u3002\u6700\u521d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30ec\u30dd\u30fc\u30c8\u306e\u3044\u308f\u3086\u308b\u30ab\u30b9\u30bf\u30e0 \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u3001\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u3054\u3068\u306b\u7570\u306a\u308a\u307e\u3059\u30022 \u756a\u76ee\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u30b7\u30b9\u30c6\u30e0 \u30aa\u30d7\u30b7\u30e7\u30f3 (\u30a2\u30af\u30bb\u30b9\u3001\u901a\u77e5\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb) \u3092\u5b9a\u7fa9\u3059\u308b\u3082\u306e\u3067\u3001\u3059\u3079\u3066\u306e\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u540c\u3058\u3067\u3059\u3002\u3053\u306e\u30c8\u30d4\u30c3\u30af\u3067\u306f\u3001\u30ec\u30dd\u30fc\u30c8 \u30d5\u30a9\u30fc\u30e0\u3078\u306e\u5165\u529b\u65b9\u6cd5\u3068\u3001\u3053\u308c\u3089\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u30ec\u30dd\u30fc\u30c8\u306e\u751f\u6210\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30d5\u30a9\u30fc\u30e0 \u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p>TestRail \u306e\u30d3\u30eb\u30c8\u30a4\u30f3 \u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u3059\u3079\u3066\u67d4\u8edf\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u3067\u3042\u308a\u3001\u751f\u6210\u3055\u308c\u308b\u30ec\u30dd\u30fc\u30c8\u306e\u30b9\u30b3\u30fc\u30d7\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u3001\u8a73\u7d30\u30ec\u30d9\u30eb\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002\u30bf\u30d6\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u3055\u307e\u3056\u307e\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u69cb\u9020\u5316\u3057\u3001\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u306e\u306f\u3088\u3044\u8003\u3048\u3067\u3059\u3002\u3053\u308c\u306f\u901a\u5e38\u3001\u65b0\u3057\u3044\u30ec\u30dd\u30fc\u30c8 \u30d5\u30a9\u30fc\u30e0\u3092\u8a2d\u8a08\u3059\u308b\u969b\u306e\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">&lt;div class=\"tabs\"&gt;\n  &lt;div class=\"tab-header\"&gt;\n    &lt;a href=\"javascript:void(0)\" class=\"tab1 current\" rel=\"1\"\n      onclick=\"App.Tabs.activate(this)\"&gt;\n        &lt;?= lang('reports_tpr_form_details') ?&gt;&lt;\/a&gt;\n    &lt;a href=\"javascript:void(0)\" class=\"tab2\" rel=\"2\"\n      onclick=\"App.Tabs.activate(this)\"&gt;\n        &lt;?= lang('reports_tpr_form_runs') ?&gt;&lt;\/a&gt;\n  &lt;\/div&gt;\n  &lt;div class=\"tab-body tab-frame\"&gt;\n    &lt;div class=\"tab tab1\"&gt;\n      &lt;!-- The content of tab 1 goes here --&gt;\n    &lt;\/div&gt;\n    &lt;div class=\"tab tab2 hidden\"&gt;\n      &lt;!-- The content of tab 2 goes here --&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p>\u8907\u6570\u306e\u76ee\u7684\u3092\u6301\u3064\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5834\u5408\u306f\u3001\u901a\u5e38\u3001\u8a73\u7d30\u30ec\u30d9\u30eb\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u306b\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u306e\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u30c6\u30b9\u30c8 \u30b1\u30fc\u30b9\u306e\u30bf\u30a4\u30d7\u3068\u512a\u5148\u9806\u4f4d\u3054\u3068\u306e\u7d50\u679c\u5206\u5e03\u3092\u8868\u793a\u3059\u308b\u30ec\u30dd\u30fc\u30c8\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u601d\u3044\u51fa\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u5834\u5408\u306b\u5f79\u7acb\u3064\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306e\u5305\u542b\/\u9664\u5916\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u306b\u306f\u3001<strong>report.php<\/strong> \u306e\u30d5\u30a9\u30fc\u30e0\u306b\u95a2\u9023\u3059\u308b\u95a2\u6570\u306b\u8a18\u8ff0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u307e\u305a\u3001<strong>prepare_form <\/strong>\u304b\u3089\u59cb\u3081\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u306f\u3001\u30d5\u30a9\u30fc\u30e0\u3092\u6e96\u5099\u3057\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function prepare_form($context, $validation)\n{\n  \/\/ Assign the validation rules for the fields on the form.\n  $validation-&gt;add_rules(\n    array(\n      'custom_types_include' =&gt; array(\n        'type' =&gt; 'bool',\n        'default' =&gt; false\n      ),\n      'custom_priorities_include' =&gt; array(\n        'type' =&gt; 'bool',\n        'default' =&gt; false\n      )\n    )\n  );\n \n  if (request::is_post())\n  {\n    return;\n  }\n \n  \/\/ We assign the default values for the form depending on the\n  \/\/ event. For 'add', we use the default values of this plugin.\n  \/\/ For 'edit\/rerun', we use the previously saved values of\n  \/\/ the report\/report job to initialize the form. Please note\n  \/\/ that we prefix all fields in the form with 'custom_' and\n  \/\/ that the storage format omits this prefix (validate_form).\n \n  if ($context['event'] == 'add')\n  {\n    $defaults = array(\n      'types_include' =&gt; true,\n      'priorities_include' =&gt; true\n    );\n  }\n  else\n  {\n    $defaults = $context['custom_options'];\n  }\n \n  foreach ($defaults as $field =&gt; $value)\n  {\n    $validation-&gt;set_default('custom_' . $field, $value);\n  }\n}<\/pre>\n<p>\u95a2\u6570\u306f\u6b21\u306e 2 \u3064\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u6e21\u3055\u308c\u305f <strong>$validation<\/strong> \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u691c\u8a3c\u30eb\u30fc\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u6b21\u306b\u3001\u3053\u308c\u3089\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<strong>$context<\/strong> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u65b0\u3057\u3044\u30ec\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u306e\u304b\u65e2\u5b58\u306e\u30ec\u30dd\u30fc\u30c8\u3092\u7de8\u96c6\/\u518d\u5b9f\u884c\u3059\u308b\u306e\u304b\u3092\u6c7a\u5b9a\u3059\u308b\u65b9\u6cd5\u3068\u3001\u6c7a\u5b9a\u306b\u3088\u3063\u3066\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e\u51e6\u7406\u304c\u7570\u306a\u308b\u70b9\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b <strong>validate_form<\/strong> \u306b\u8a18\u8ff0\u3092\u8ffd\u52a0\u3057\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u691c\u8a3c\/\u8fd4\u5374\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function validate_form($context, $input, $validation)\n{\n  \/\/ At least one detail entity option must be selected (types or\n  \/\/ priorities).\n  if (!$input['custom_types_include'] &amp;&amp;\n    !$input['custom_priorities_include'])\n  {\n    $validation-&gt;add_error(\n      lang('reports_tpr_form_details_include_required')\n    );\n \n    return false;\n  }\n \n  $values = array();\n \n  static $fields = array(\n    'types_include',\n    'priorities_include'\n  );\n \n  foreach ($fields as $field)\n  {\n    $key = 'custom_' . $field;\n    $values[$field] = arr::get($input, $key);\n  }\n \n  return $values;\n}<\/pre>\n<p>\u5358\u7d14\u306a\u691c\u8a3c\u30b7\u30ca\u30ea\u30aa\u306f <strong>prepare_form<\/strong> \u3067\u8a2d\u5b9a\u3055\u308c\u305f\u691c\u8a3c\u30eb\u30fc\u30eb\u3067\u3059\u3067\u306b\u30ab\u30d0\u30fc\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001<strong>validate_form<\/strong> \u3067\u306f\u3001\u3088\u308a\u8907\u96d1\u306a\u30b7\u30ca\u30ea\u30aa\u3092\u51e6\u7406\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u30d5\u30a9\u30fc\u30e0\u4e0a\u3067\u5c11\u306a\u304f\u3068\u3082 1 \u3064\u306e\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3 (\u30bf\u30a4\u30d7\u307e\u305f\u306f\u512a\u5148\u9806\u4f4d) \u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30ec\u30dd\u30fc\u30c8\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5f8c\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0 \u30b9\u30c6\u30c3\u30d7\u3067\u4f7f\u7528\u3059\u308b\u306e\u3067\u3001\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d9a\u3044\u3066 <strong>form.php<\/strong> \u306e\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u5fdc\u3059\u308b\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">..\n&lt;!-- The content of tab 1 goes here --&gt;\n&lt;p class=\"top\"&gt;&lt;?= lang('reports_tpr_form_details_include') ?&gt;&lt;\/p&gt;\n&lt;div class=\"checkbox form-checkbox\" style=\"margin-left: 15px\"&gt;\n  &lt;label&gt;\n    &lt;?= lang('reports_tpr_form_details_include_types') ?&gt;\n    &lt;input type=\"checkbox\" id=\"custom_types_include\"\n      name=\"custom_types_include\" value=\"1\"\n      &lt;?= validation::get_checked('custom_types_include',1) ?&gt; \/&gt;\n  &lt;\/label&gt;\n&lt;\/div&gt;\n&lt;div class=\"checkbox\" style=\"margin-left: 15px\"&gt;\n  &lt;label&gt;\n    &lt;?= lang('reports_tpr_form_details_include_priorities') ?&gt;\n    &lt;input type=\"checkbox\" id=\"custom_priorities_include\"\n      name=\"custom_priorities_include\" value=\"1\"\n      &lt;?= validation::get_checked('custom_priorities_include',1) ?&gt; \/&gt;\n  &lt;\/label&gt;\n&lt;\/div&gt;\n..<\/pre>\n<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-options.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-options.png\" alt=\"\" width=\"550\" height=\"121\" class=\"aligncenter size-full wp-image-9049\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-options.png 550w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-options-480x106.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 550px, 100vw\" \/><\/a><\/p>\n<h2>\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb<\/h2>\n<p>\u30ab\u30b9\u30bf\u30e0 \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u8907\u96d1\u306a\u30d5\u30a9\u30fc\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u591a\u304f\u306e\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u540c\u3058\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5171\u6709\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f55\u5ea6\u3082\u5b9f\u88c5\u3059\u308b\u306e\u306f\u5408\u7406\u7684\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5e78\u3044\u306a\u3053\u3068\u306b\u3001TestRail \u306e\u30ec\u30dd\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u306f\u300c\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u300d\u3068\u547c\u3070\u308c\u308b\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3088\u304f\u5229\u7528\u3055\u308c\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3057\u3066\u304a\u308a\u3001\u30d3\u30eb\u30c8\u30a4\u30f3\u306e\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u3084\u30ab\u30b9\u30bf\u30e0 \u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u518d\u5229\u7528\u3067\u304d\u307e\u3059\u3002\u30b9\u30c6\u30fc\u30bf\u30b9\u3001\u30e6\u30fc\u30b6\u30fc\u3001\u30c6\u30b9\u30c8 \u30b9\u30a4\u30fc\u30c8\u3001\u30c6\u30b9\u30c8 \u30e9\u30f3\u306a\u3069\u306e\u30bb\u30c3\u30c8\u3092\u9078\u629e\u3059\u308b\u305f\u3081\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u300c\u30b9\u30b3\u30fc\u30d7\u300d\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u4eca\u56de\u306e\u4f8b\u3067\u306f\u3001\u751f\u6210\u3055\u308c\u308b\u30ec\u30dd\u30fc\u30c8\u306b\u542b\u3081\u308b\u30c6\u30b9\u30c8 \u30e9\u30f3\u3092\u30b9\u30b3\u30fc\u30d7\u3068\u3059\u308b\u305f\u3081\u3001\u5b9f\u884c\u9078\u629e\u304a\u3088\u3073\u5b9f\u884c\u5236\u9650\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<strong>report.php<\/strong> \u3067\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\/\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">class Tests_property_results_report_plugin extends Report_plugin\n{\n  private $_controls;\n \n  \/\/ The controls and options for those controls that are used on\n  \/\/ the form of this report.\n  private static $_control_schema = array(\n    'runs_select' =&gt; array(\n      'namespace' =&gt; 'custom_runs',\n      'multiple_suites' =&gt; true\n    ),\n    'runs_limit' =&gt; array(\n      'type' =&gt; 'limits_select',\n      'namespace' =&gt; 'custom_runs',\n      'min' =&gt; 0,\n      'max' =&gt; 100,\n      'default' =&gt; 25\n    )\n  );\n \n  ..\n \n  public function __construct()\n  {\n    parent::__construct();\n    $this-&gt;_controls = $this-&gt;create_controls(\n      self::$_control_schema\n    );\n  }\n \n  public function prepare_form($context, $validation)\n  {\n    \/\/ Assign the validation rules for the controls used on the\n    \/\/ form.\n    $this-&gt;prepare_controls($this-&gt;_controls, $context, \n      $validation);\n \n    ..\n  }\n \n  public function validate_form($context, $input, $validation)\n  {\n    ..\n \n    \/\/ We begin with validating the controls used on the form.\n    $values = $this-&gt;validate_controls(\n      $this-&gt;_controls,\n      $context,\n      $input,\n      $validation);\n \n    if (!$values)\n    {\n      return false;\n    }\n \n    ..\n  }\n \n  public function render_form($context)\n  {\n    $params = array(\n      'controls' =&gt; $this-&gt;_controls,\n      'project' =&gt; $context['project']\n    );\n \n    ..\n  }\n}<\/pre>\n<p>\u57fa\u672c\u7684\u306b\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u30b9\u30ad\u30fc\u30de\u306b\u57fa\u3065\u3044\u3066\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u5185\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3001<strong>prepare_form<\/strong> \u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u767b\u9332\u3057\u3066 <strong>validate_form<\/strong> \u3067\u691c\u8a3c\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u5fc5\u305a\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u30d5\u30a9\u30fc\u30e0 \u30d3\u30e5\u30fc\u306b\u6e21\u3057\u307e\u3059\u3002\u3042\u3068\u306f\u3001\u5bfe\u5fdc\u3059\u308b\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9 \u30b3\u30fc\u30c9\u3092 <strong>form.php<\/strong> \u306b\u57cb\u3081\u8fbc\u3080\u3060\u3051\u3067\u3059<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">\/\/The content of tab 2 goes here\n$report_obj-&gt;render_control(\n  $controls,\n  'runs_select',\n  array(\n    'top' =&gt; true,\n    'project' =&gt; $project\n  )\n)\n\n$report_obj-&gt;render_control(\n  $controls,\n  'runs_limit',\n  array(\n    'intro' =&gt; lang('report_plugins_runs_limit'),\n    'limits' =&gt; array(5, 10, 25, 50, 100, 0)\n  )\n)<\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u30ec\u30dd\u30fc\u30c8 \u30d5\u30a9\u30fc\u30e0\u306e [<strong>\u30c6\u30b9\u30c8 \u30b9\u30a4\u30fc\u30c8\u3068\u30c6\u30b9\u30c8 \u30e9\u30f3<\/strong>] \u30bf\u30d6\u306b\u5207\u308a\u66ff\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-controls.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-controls.png\" alt=\"\" width=\"550\" height=\"531\" class=\"aligncenter size-full wp-image-9048\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-controls.png 550w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-content\/uploads\/form-controls-480x463.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 550px, 100vw\" \/><\/a><\/p>\n<p><strong>report.php<\/strong> \u306e\u30d5\u30a9\u30fc\u30e0 \u30e1\u30bd\u30c3\u30c9\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb \u30b5\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u3053\u3068\u3067\u3001\u9078\u629e\u3055\u308c\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u5024\u304c\u81ea\u52d5\u7684\u306b\u30ec\u30dd\u30fc\u30c8 \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u4fdd\u5b58\u3055\u308c\u3001\u30ec\u30dd\u30fc\u30c8\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3068\u304d\u306b\u6a19\u6e96\u306e <strong>$options<\/strong> \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u901a\u3058\u3066\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30ec\u30dd\u30fc\u30c8 \u30d8\u30eb\u30d1\u30fc<\/h2>\n<p>\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3068\u540c\u69d8\u306b\u3001TestRail \u306e\u30ec\u30dd\u30fc\u30c8 \u30a8\u30f3\u30b8\u30f3\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u308b\u305f\u3081\u306e\u4e00\u822c\u7684\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u95a2\u9023\u30af\u30a8\u30ea\u30fc\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3082\u63d0\u4f9b\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30af\u30a8\u30ea\u30fc\u306f\u3001\u300c\u30ec\u30dd\u30fc\u30c8 \u30d8\u30eb\u30d1\u30fc\u300d\u306b\u542b\u307e\u308c\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u30e1\u30bd\u30c3\u30c9\u3092\u4ecb\u3057\u3066\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30d8\u30eb\u30d1\u30fc\u306f <strong>report.php<\/strong> \u3067\u306f <strong>$this\u2192_helper<\/strong> \u3001\u30ec\u30dd\u30fc\u30c8 \u30d3\u30e5\u30fc\u3067\u306f\u00a0 <strong>$report_helper<\/strong> \u306b\u3088\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d8\u30eb\u30d1\u30fc\u306e\u591a\u304f\u306e\u6a5f\u80fd\u306f\u3001\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3055\u308c\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u8a73\u7d30\u306f\u4ee5\u4e0b\u306e\u4f8b\u3067\u8aac\u660e\u3057\u307e\u3059\u3002\u30ec\u30dd\u30fc\u30c8\u306e\u5b9f\u969b\u306e\u8868\u793a\u51e6\u7406 (report.php \u306e <strong>run<\/strong> \u30e1\u30bd\u30c3\u30c9) \u306b\u79fb\u52d5\u3057\u3066\u3001\u30ec\u30dd\u30fc\u30c8\u306e\u7bc4\u56f2\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">public function run($context, $options)\n{\n  $project = $context['project'];\n \n  \/\/ Read the test suites first.\n  $suites = $this-&gt;_helper-&gt;get_suites_by_include(\n    $project-&gt;id,\n    $options['runs_suites_ids'],\n    $options['runs_suites_include']\n  );\n \n  $suite_ids = obj::get_ids($suites);\n \n  \/\/ We then get the actual list of test runs used, depending on\n  \/\/ the report options.\n  if ($suite_ids)\n  {\n    $runs = $this-&gt;_helper-&gt;get_runs_by_include(\n      $project-&gt;id,\n      $suite_ids,\n      $options['runs_include'],\n      $options['runs_ids'],\n      $options['runs_filters'],\n      null, \/\/ Active and completed\n      $options['runs_limit'],\n      $run_rels,\n      $run_count\n    );\n  }\n  else\n  {\n    $runs = array();\n    $run_rels = array();\n    $run_count = 0;\n  }\n \n  $run_ids = obj::get_ids($runs);\n \n  ..\n}<\/pre>\n<p>\u30d5\u30a9\u30fc\u30e0 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u30aa\u30d7\u30b7\u30e7\u30f3 (<strong>$options<\/strong> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059) \u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u8a72\u5f53\u3059\u308b\u30c6\u30b9\u30c8 \u30b9\u30a4\u30fc\u30c8\u304a\u3088\u3073\u5b9f\u884c\u3092\u8aad\u307f\u53d6\u308a\u3001\u30ec\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u30ec\u30dd\u30fc\u30c8 \u30d8\u30eb\u30d1\u30fc\u306f\u591a\u304f\u306e\u8ffd\u52a0\u306e \u30e1\u30bd\u30c3\u30c9 \u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u5168\u4f53\u306e\u6982\u8981\u3092\u7406\u89e3\u3059\u308b\u306b\u306f\u3001&lt;TestRail&gt;\/app\/plugins\/reports \u306b\u3042\u308b\u30d3\u30eb\u30c8\u30a4\u30f3 \u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30bd\u30fc\u30b9 \u30b3\u30fc\u30c9\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7<\/h2>\n<p>\u6700\u5f8c\u306e\u30d1\u30fc\u30c8\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30ab\u30b9\u30bf\u30e0 \u30af\u30a8\u30ea\u30fc\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3068\u3001\u30c7\u30fc\u30bf\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><a href=\"\/custom-report-3\" target=\"_self\" rel=\"noopener\"><strong>\u30ab\u30b9\u30bf\u30e0 \u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4f5c\u6210 (3)<\/strong><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u5e38\u3001\u30ec\u30dd\u30fc\u30c8 \u30d5\u30a9\u30fc\u30e0\u306f 2 \u3064\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u5206\u304b\u308c\u3066\u3044\u307e\u3059\u3002\u6700\u521d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30ec\u30dd\u30fc\u30c8\u306e\u3044\u308f\u3086\u308b\u30ab\u30b9\u30bf\u30e0 \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u3001\u30ec\u30dd\u30fc\u30c8 \u30d7\u30e9\u30b0\u30a4\u30f3\u3054\u3068\u306b\u7570\u306a\u308a\u307e\u3059\u30022 \u756a\u76ee\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u30b7\u30b9 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":14805,"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-17828","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/pages\/17828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/comments?post=17828"}],"version-history":[{"count":26,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/pages\/17828\/revisions"}],"predecessor-version":[{"id":23533,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/pages\/17828\/revisions\/23533"}],"up":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/pages\/14805"}],"wp:attachment":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/801\/wp-json\/wp\/v2\/media?parent=17828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}