Versions Compared

Key

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

Request

To change a parser template, use the following API operation of your Zephyr server: 

...

Use the payload like this: 

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

...

Response

Zephyr’s response will be like this: 

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

...

  • 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 – Used internallyReserved 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. 

  • ModifiedOnmodifiedOn – The timestamp of the update. 

...

Create, Edit and Delete Parser Templates

Parser Templates

Parser Template Syntax