Edit Parser Templates
Starting October 11, 2024 (Zephyr Enterprise 8.2), the Zephyr Enterprise documentation 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/edit-parser-templates.html
Request
To change a parser template, use the following API operation of your Zephyr server:Â
PUTÂ Â http(s)://{your-zephyr}/flex/services/rest/latest/parsertemplate/{template-id}Â
Here,Â
your-zephyr is the host name or IP address of your Zephyr server.
template-id is the ID of the desired template. You get this ID when you create a template.Â
Use the payload like this:Â
{
"name": "Updated 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}\"}
]
}]"
}
The payload has two top-level properties:Â
name
 – The name of a test tool or framework.Â
jsonTemplate
 – New JSON data of a template. See Parser Template Syntax for details.
Response
Zephyr’s response will be like this:Â
{
"id": 101,
"name": "Updated 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,
"modifiedBy": 1,
"createdOn": 1581580704000,
"modifiedOn": 1581581761418
}
Response fields:Â
id
 – The template ID in Zephyr. It’s the same ID that you specify in the request URL.Â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.ÂmodifiedBy
 – The ID of the user who modified the template.ÂmodifiedOn
 – The timestamp of the update.Â
Note
Pre-configured templates cannot be modified.Â
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