Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Starting Release 8.2, Zephyr Enterprise documentation has moved from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise Documentation page. Please see: https://support.smartbear.com/zephyr-enterprise/docs/en/zephyr-enterprise/zephyr-user-guide/zephyr-test-automation/parser-templates/create,-edit-and-delete-templates/create-parser-templates.html

Request

To create a parser template, send the following API request to your Zephyr server: 

POST http(s)://{your-zephyr}/flex/services/rest/latest/parsertemplate 

where your-zephyr is the host name or IP address of your Zephyr server.

The request body should look like this:

{
  "name": "My custom parser", 
  "jsonTemplate": "[{  
    status: \"${testsuite.testcase.failure}\",  
    stepText: \"${testsuite.testcase.failure}${testsuite.testcase.system-out}\",  
    statusExistPass: false,  
    statusString: null,  
    statusFailAttachmentText: \"${testsuite.testcase.failure:message}\", 
    statusPassAttachmentText: \"classname: ${testsuite.testcase:classname} name: ${testsuite.testcase:name} time: ${testsuite.testcase:time}\",
    packageName: \"${testsuite.testcase:classname}\",
    skipTestcaseNames: \"\",
    testcase: { 
      name: \"${testsuite.testcase:name}\" 
    },
    requirements: [
      { id: \"${testsuite.testcase.requirements.requirement}\" } 
    ],
    attachments: [
      { filePath: \"${testsuite.testcase.attachments.attachment}\" }
    ]
  }]"
}

This JSON object has two top-level properties: 

Response

The Zephyr response will look like this -- 

{ 
  "id": 101, 
  "name": "My custom parser", 
  "jsonTemplate": "[{  
    \"status\": \"${testsuite.testcase.failure}\",
    \"stepText\": \"${testsuite.testcase.failure}${testsuite.testcase.system-out}\",  
    \"statusExistPass\": false,
    \"statusString\": null,
    \"statusFailAttachmentText\": \"${testsuite.testcase.failure:message}\",
    \"statusPassAttachmentText\": \"classname: ${testsuite.testcase:classname} name: ${testsuite.testcase:name} time: ${testsuite.testcase:time}\",
    \"packageName\": \"${testsuite.testcase:classname}\",
    \"skipTestcaseNames\": \"\",
    \"testcase\" : {\"name\": \"${testsuite.testcase:name}\"},
    \"requirements\": [ 
        {\"id\": \"${testsuite.testcase.requirements.requirement}\"}
    ],
    \"attachments\": [
        {\"filePath\": \"${testsuite.testcase.attachments.attachment}\"}
    ]
  }]",
  "isDeleted": false, 
  "isDefault": false, 
  "isSbAutomationTool": false,
  "createdBy": 1,
  "createdOn": 1581580703992 
}

Here --

  • id – An identifier that Zephyr assigned to the template. You will use it to specify a template you want to edit or delete. 

  • jsonTemplate – The template contents (see Parser Template Syntax). 

  • isDeleted – Indicates whether the template has been deleted or not. 

  • isDefault – true if a template is a pre-configured request, or false if it is a user-defined request.  

  • isSbAutomationTool – Reserved for internal use.

  • createdBy – The id of the user who created the template. 

  • createdOn – The creation timestamp. 

Note

A template becomes available right after you created it. All the templates are available for your entire organization in Zephyr. 

See Also

Create, Edit and Delete Parser Templates

Parser Templates

Parser Template Syntax

  • No labels