0

根据此处的文档,我尝试使用以下输入导入我的 JUnit 样式 XML。curl -H "Content-Type:multipart/form-data" -u mylogin:mypassword -F "file=@output.xml" https://jira.nayax.com/rest/raven/1.0/import/execution/junit ?projectKey=TGP&testPlanKey=TGP-25

我使用这篇文章使用 XSL 将我的 JMeter XML 输出转换为 JUnit 格式。输出是:

输出.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
   <testsuite>
      <testcase classname="httpSample" name="Set-up Thread: loginUsingPOST - Success"
                time="0.789">
         <failure/>
      </testcase>
      <testcase classname="httpSample" name="Set-up Thread: loginUsingPOST - Success"
                time="0.631">
         <failure/>
      </testcase>
      <testcase classname="httpSample" name="createNfcTagUsingPOST - Success" time="0.282">
         <failure/>
      </testcase>
      <testcase classname="httpSample" name="handleTagDetectionUsingPOST - Success"
                time="0.311">
         <failure>Test failed: code expected to equal /

****** received  : [[[403]]]

****** comparison: [[[200]]]

/</failure>
      </testcase>
   </testsuite>
</testsuites>

输出是:

{"error":"Error assembling issue data: Field \u0027customfield_11033\u0027 cannot be set. It is not on the appropriate screen, or unknown."}

当我在浏览器的源代码视图中查看测试时,该字段被隐藏:

    <input type="hidden" name="raven-testexec-test-customFieldId" 
id="raven-testexec-test-customFieldId" value="customfield_11033"/>
    <input type="hidden" name="raven-testexec-test-customFieldEnv" 
id="raven-testexec-test-customFieldEnv" value="14440"/>
    <input type="hidden" name="raven-testexec-test-revisionId" 
id="raven-testexec-test-revisionId" value="customfield_14437"/>
    <input type="hidden" name="raven-testexec-test-sprintId" 
id="raven-testexec-test-sprintId" value="customfield_10105"/>

所以它看起来像customfield_11033被映射到这个名为 的通用事物customFieldId,就像(例如)customfield_10105被映射到sprintId.

所以这是什么customFieldId??

当我在源代码视图中查看测试执行并搜索时11033,我根本没有找到它。

其他尝试

我在 XRay 的文档站点上读到可以使用multipart各种 API,但我得到了相同的结果。

curl -H "Content-Type:multipart/form-data" -u login:password -F "file=@output.xml" -F "testInfo=@test_info.json" -F "info=@test_exec_info.json" https://jira.nayax.com/rest/raven/1.0/import/execution/junit/multipart
test_exec_info.json
{
    "fields": {
        "project": {
            "id": "12900",
            "key": "TGP"
        },
        "summary": "Test Execution for JMeter Execution"
    }
}
test_info.json
{
    "fields": {
        "description": "Game Activation"
    }
}
这是一个测试问题的屏幕截图

在此处输入图像描述 在此处输入图像描述

这是项目中测试执行的屏幕截图

在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

我没有 Jira 布局的管理员权限。Jira 管理员公开此自定义字段以使我的导入正常工作是必要条件吗?

4

1 回答 1

1

首先,感谢您提供所有这些信息。经过一番调查,您的 Jira 管理员似乎没有正确配置问题屏幕或可能已更改它们。给您错误的自定义字段是“测试与测试执行的关联”。该字段需要在测试执行问题的编辑屏幕上(即根据您的项目配置在用于测试执行的编辑屏幕上)。

更多关于这里这里

配置名为 Tests 的自定义字段与测试执行关联

如果您的 Jira 管理员需要帮助,请随时联系 Xray 支持团队

于 2022-02-22T15:58:53.887 回答