【问题标题】:Jira REST API, JSON to create an Issue of type Test with test detailJira REST API,JSON 用于创建带有测试详细信息的 Test 类型问题
【发布时间】:2017-09-28 13:13:30
【问题描述】:

到目前为止,我设法创建了测试问题,但找不到正确的 JSON 结构来填充该字段: customfield_11101 ,名称:Zephyr Teststep ,必填:false ,类型:任意

我希望能够做这样的事情:

var issueTest = {
    "fields": {
      "issuetype": {
         "name": "Test"
      },
      "project":
      {
         "key": "STORYKEY"
      },
      "summary": "Navigate to a Different Region",
      "description": "",
      "assignee": {
          "name": "someemail@email.com"
      },
      "customfield_10014": "SOMEKEY",

      "duedate": "2018-10-03",
      "priority": {
        "name": "Blocker"
      },
      "labels": ["label1", "label2"],
      "customfield_19416": "50h",
      "customfield_19719": {
        "value": "minor"
      },
      "customfield_11101": [
        {
          "Test Step": "some text",
          "Test Data": "some text",
          "Test Result": "some text"
        },
        {
          "Test Step": "some text",
          "Test Data": "some text",
          "Test Result": "some text"
        },
        {
          "Test Step": "some text",
          "Test Data": "some text",
          "Test Result": "some text"
        }
      ]
   }
};

【问题讨论】:

    标签: json rest api jira


    【解决方案1】:

    我对 Zephyr 领域并不完全熟悉,但您是否尝试过这样的事情:

    "fields": {
      //other field data
      "customfield_11101": {
        "value": //put your array here
      }
    }
    

    如果这不起作用,则在您的 JIRA 实例中找到另一个填写该字段并通​​过 API 查询的问题,然后您可以查看该字段值的结构应该是什么

    第三,如果一切都失败了,Zephyr 有自己的API,您可以使用它来进行所需的更改。甚至还有一个单独的TeststepResource 端点。

    【讨论】:

      【解决方案2】:

      首先我要感谢@rorschach,他的回答对我帮助很大。

      我找到了办法。这并不理想,但有效 这个想法是创建测试并使用新的测试 id 来创建相关步骤(@rorschach 建议):

      http://docs.getzephyr.apiary.io/#reference/teststepresource/create-get-list-of-teststeps/create-new-teststep

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-11-12
        • 2020-09-28
        • 2015-11-03
        • 1970-01-01
        • 1970-01-01
        • 2019-12-21
        相关资源
        最近更新 更多