Get Product List

2020-03-24 10:33:25
John Ten
33
Last edited by John Ten on 2020-03-24 16:29:02
Summary : Request this method to get all active product details and all product names.
Method Description Request this method to get all active product details and all product names.
Example
public function getProductList()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao      = new \zentao();
    $extraFields = array('title', 'products', 'productStats');    // customize fields returned
    $result      = $zentao->getProductList(array(), $extraFields);
    return $result;
}
Request
GET
Method
getProductList
Parameter
N/A
Result
success
{
    "status": 1,
    "msg": "success",
    "result": {
        // the navbar of ZenTao
        "title": "All Products",
        // the names of all product lists
        "products": {
            "1": "ZenTao ALM",
            "2": "Product B",
            "3": "Product C",
            "4": "Product D",
            "5": "Product E",
            "6": "Product F"
        },
        // the detailed list of the active products
        "productStats": [
            {
                "id": "6",// Product ID
                "name": "Product F",// product name
                "code": "cp6",// product alias
                "line": "0",// product line
                "type": "branch",// product type【normal|branch|platform】
                "status": "normal",// product status
                "subStatus": "",
                "desc": "Product F Product F Product F Product F Product F",// product description
                "PO": "lisi",// PO
                "QD": "zhapliu",// test manager
                "RD": "zhapliu",// release manager
                "acl": "open",// access control【open|private|custom】
                "whitelist": "",// whitelist
                "createdBy": "admin",// product creator
                "createdDate": "2019-11-19 18:41:02",// created time
                "createdVersion": "11.6.4",// ZenTao version number
                "order": "30",// order in the list
                "deleted": "0",// deleted【0=no, 1=yes】
                "stories": {
                    "0": "",
                    "1": "draft",
                    "2": "active",
                    "3": "closed",
                    "4": "changed",
                    "_empty_": 0,
                    "draft": 0,// draft story
                    "active": 0,// active story
                    "closed": 0,// closed story
                    "changed": 0// changed story
                },
                "plans": 0,// no. of plans
                "releases": 0,// no. of releases
                "bugs": 0,// no. of bugs
                "unResolved": 0,// no. of bugs not solved
                "assignToNull": 0//no. of bugs that are not assigned to anyone
            }
        ]
    }
}
error
{
    "status": 0,
    "msg": "error",
    "result": []
}
Write a Comment
Comment will be posted after it is reviewed.