Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 

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

Use a payload like this for the requestThe request body should look like this:

Code Block
languagejson
{
  "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}\" }
    ]
 ] }]"
}

As you can see, the payload structure This JSON object has two top-level properties: 

...

The Zephyr response will look like this -- 

Code Block
languagejson
{ 
  "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 
}

...

  • 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 – Used internally.  – Reserved for internal use.

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

  • createdOn – The creation timestamp. 

...

Create, Edit and Delete Parser Templates

Parser Templates

Parser Template Syntax