Get Bug List

2020-03-24 10:59:26
John Ten
3503
Last edited by Taotao on 2020-03-25 10:48:33
Share links
Summary : Request this method to get a list of bugs based on the status of different products.

Method Description

Request this method to get a list of bugs based on the status of different products.

Example
public function getBugList()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao      = new \zentao();
    $params      = array('productID' => 1, 'branch' => 0, 'browseType' => 'unresolved');    // request parameters
    $extraFields = array('title', 'products', 'productID', 'productName', 'product', 'moduleName', 'modules', 'browseType', 'bugs');    // customize fields
    $result      = $zentao->getBugList($params, $extraFields);
    return $result;
}
Request
GET
Method

getBugList

Parameter
Name
Type
Required
Description
productID
int Required Product ID
branch
int Required Branch ID【default:0】
browseType
string
Optional Optional parameter|Bug status【all|unclosed|openedbyme|assigntome|resolvedbyme|toclosed|unresolved|unconfirmed|longlifebugs|postponedbugs|overduebugs|needconfirm】
Result
success error
{
    "status": 1,
    "msg": "success",
    "result": {
        //the navbar of ZenTao
        "title": "ZenTao-PHP-SDK-Bug",
        // a product list
        "products": {
            "1": "ZenTao-PHP-SDK",
            "2": "Product B",
            "3": "Product C",
            "4": "Product D",
            "5": "Product E",
            "6": "Product F",
            "9": "Product X"
        },
        // current product ID
        "productID": 1,
        // current product name
        "productName": "ZenTao-PHP-SDK",
        //current product details
        "product": {
            "id": "1",
            "name": "ZenTao-PHP-SDK",
            "code": "001",
            "line": "0",
            "type": "normal",
            "status": "normal",
            "subStatus": "",
            "desc": "ZenTao PHP-SDK Dev is used to manage projects via PHPer more efficiently",
            "PO": "admin",
            "QD": "admin",
            "RD": "admin",
            "acl": "open",
            "whitelist": "",
            "createdBy": "admin",
            "createdDate": "2019-11-11 12:22:29",
            "createdVersion": "11.6.4",
            "order": "5",
            "deleted": "0"
        },
        // current product modules
        "moduleName": "All Modules",
        // current product module list
        "modules": [
            "/",
            "/Design",
            "/Dev",
            "/Change",
            "/Test"
        ],
        // current stattus of a bug
        "browseType": "unclosed",
        // current bug list
        "bugs": [
            {
                "id": "7",//BUG ID
                "product": "1",// linked product ID
                "branch": "0",// linked branch ID
                "module": "2",// linked module ID
                "project": "1",// linked project ID
                "plan": "0",// linked plan ID
                "story": "0",
                "storyVersion": "1",
                "task": "0",
                "toTask": "0",
                "toStory": "0",
                "title": "Add test 3 for the bug",// bug title
                "keywords": "change bug",// bug keywords
                "severity": "2",// bug severity
                "pri": "1",// priority
                "type": "codeerror",// bug type
                "os": "windows",// OS
                "browser": "ie11",// browser
                "hardware": "",
                "found": "",
                "steps": "Repro steps to describe Add test 3 for bug",// reproduce steps
                "status": "active",// bug status【active|resolved|closed】
                "subStatus": "",
                "color": "#2dbdb2",// bug color
                "confirmed": "0",// whether confirmation is required
                "activatedCount": "0",
                "activatedDate": "0000-00-00 00:00:00",
                "mailto": "zhangsan",
                "openedBy": "admin",
                "openedDate": "2019-11-21 16:45:58",
                "openedBuild": "Trunk",
                "assignedTo": "zhangsan",
                "assignedDate": "2019-11-21 16:45:58",
                "deadline": "2019-11-21",
                "resolvedBy": "",
                "resolution": "",
                "resolvedBuild": "",
                "resolvedDate": "0000-00-00 00:00:00",
                "closedBy": "",
                "closedDate": "0000-00-00 00:00:00",
                "duplicateBug": "0",
                "linkBug": "",
                "case": "0",
                "caseVersion": "1",
                "result": "0",
                "testtask": "0",
                "lastEditedBy": "",
                "lastEditedDate": "0000-00-00 00:00:00",
                "deleted": "0",
                "delay": 1,
                "needconfirm": false
            }
        ]
    }
}
{
    "status": 0,
    "msg": "error",
    "result": []
}

Write a Comment
Comment will be posted after it is reviewed.