Create Parser Templates
Request
To create a parser template, send the following API request to your Zephyr server:Â
POSTÂ http://{your-zephyr}/flex/services/rest/latest/parsertemplateÂ
Here, your-zephyr is the IP address or host name of your Zephyr server.
Use a payload like this for the request:
{
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 has two top-level properties:Â
name
 – The name of a test tool or framework. Zephyr will show it in the drop-down list of supported frameworks in Jenkins or in the zBot settings screen.ÂjsonTemplate
 – JSON data of a new template. See Parser Template Syntax for complete information on its fields.
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
 – Used internally.Â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
Â
Starting Release 8.2, Zephyr Enterprise documentation is moving from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise Documentation page. https://support.smartbear.com/zephyr-enterprise/docs/en/welcome-to-zephyr-enterprise.html