0

我正在尝试将 XRay 集成到我的 Jenkins 管道中。为此,我添加了这样一个步骤:

step([$class: 'XrayImportBuilder', endpointName: '/cucumber/multipart',credentialId:'credentials', importFilePath: cucumber_json_path, importInfo: """{
    "fields": {
        "customfield_100" : "customfield",
        "description": "description",
        "issuetype": {
            "name": "name"
        },
        "labels": ["label"],
        "project": {
            "key": "key"
        },
    "summary": "summary"
},
"xrayFields": {
     "testPlanKey": "examplekey"
} 
"""

运行管道时出现以下错误:

Starting XRAY: Results Import Task...

[2021-05-20T12:45:28.861Z] ##########################################################

[2021-05-20T12:45:28.861Z] ####     Xray is importing the execution results      ####

[2021-05-20T12:45:28.861Z] ##########################################################

[2021-05-20T12:45:28.861Z] XRAY_TEST_EXECS: 

[2021-05-20T12:45:28.861Z] XRAY_RAW_RESPONSE: The Jira server configuration of this task was not found.

[2021-05-20T12:45:28.861Z] XRAY_TESTS: 

[2021-05-20T12:45:28.861Z] XRAY_ISSUES_MODIFIED: 

[2021-05-20T12:45:28.861Z] XRAY_IS_REQUEST_SUCCESSFUL: false

The Jira server configuration of this task was not found.

我不知道如何解决这个问题。知道此设置可能有什么问题,或者我该如何调试?

4

1 回答 1

1

您需要定义“serverInstance”变量。一个例子是这样的:

step([$class: 'XrayExportBuilder', filePath: '\\features', issues: 'IF-1', serverInstance: '2ffc3a3e-9e2f-4279-abcd-e9301fe47bed'])

在此处查看一些其他示例。

于 2021-05-21T12:21:05.733 回答