0

my goal is to create a test in Zephyr for Jira using API. I found something like this on the internet

"fields": {
      "issuetype": {
         "name": "Test"
      },
      "project":
      {
         "key": "TP"
      },
      "summary": "Test From API",
      "description": "",
      "assignee": {
          "name": "Some Name"
      },
      "customfield_10014": "SOMEKEY",

      "duedate": "2018-10-03",
      "priority": {
        "name": "Medium"
      },
      "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"
        }
      ]
   }

I have really no idea what API should I use.

Recently I was able to create test cycle using the following API https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/cycle

which can be found on this page https://zfjcloud.docs.apiary.io/#reference/cycle

Unfortunately I can't find similar API for test creation. Is it possible?

PS: I am using Authorization, Content-Type, zapiAccessKey headers, where Authorization is JWT key

Thanks for the tips

Apuna12
  • 375
  • 2
  • 6
  • 23

1 Answers1

0
  1. Create an issue in JIRA via the API's. Select the issue type as Test. https://support.smartbear.com/zephyr-squad-server/docs/api/how-to/create-tests.html POST /rest/api/2/issue

  2. The above request will give you an ID that is internal to JIRA. Not the one that gets displayed in UI for any Issue/ticket that is created. Extract this ID field and then

  3. Create the test steps. https://support.smartbear.com/zephyr-squad-server/docs/api/how-to/add-steps-to-tests.html POST /rest/zapi/latest/teststep/{issueId}

I don't want to echo the contents on smartbear website. Hence, this high level workflow solution for your implementation.

Nimantha
  • 6,405
  • 6
  • 28
  • 69