Get Project List

2020-03-24 10:45:17
John Ten
3421
Last edited by Taotao on 2020-03-24 17:56:03
Share links
Summary : Request this method to get the list of products according to the status of the products.
Method Description Request this method to get the list of products according to the status of the products.
Example
public function getProjectList()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao      = new \zentao();
    $params      = array('status' => 'doing');    // request parameter
    $extraFields = array('title', 'projects', 'projectStats', 'teamMembers', 'users');    // customize fields
    $result      = $zentao->getProjectList($params, $extraFields);
    return $result;
}
Request GET
Method getProjectList
Parameter
Name Type Required Description
status
string Optional Project status【all|undone|wait|doing|suspended|closed】
Result
success error
{
    "status": 1,
    "msg": "success",
    "result": {
         //the navbar of ZenTao
        "title": "All Projects",
        // a list of project names
        "projects": {
            "1": "ZenTao PHP-SDK Dev",
            "2": "Taobao Dev",
            "3": "Tmall Dev"
        },
        // a list of project details
        "projectStats": [
            {
                "id": "1",// project ID
                "isCat": "0",
                "catID": "0",
                "type": "sprint",// project type【sprint|waterfall|ops】
                "parent": "0",
                "name": "ZenTao PHP-SDK",// project name
                "code": "002",// project code
                "begin": "2019-11-11",// start date
                "end": "2019-11-23",// end date
                "days": "10",// available work days
                "status": "doing",// project status【all|undone|wait|doing|suspended|closed】
                "subStatus": "",
                "statge": "1",
                "pri": "1",
                "desc": "ZenTao PHP-SDK Dev is used to manage projects via PHPer more efficiently",// project description
                "openedBy": "admin",// the one who creates the project
                "openedDate": "2019-11-11 15:24:14",// create time
                "openedVersion": "11.6.4",// ZenTao version number
                "closedBy": "",// the one who closed the project
                "closedDate": "0000-00-00 00:00:00",// close time
                "canceledBy": "",// the one who closed the project
                "canceledDate": "0000-00-00 00:00:00",// cancel time
                "PO": "zhangsan",// PO
                "PM": "niuqi",// PM
                "QD": "admin",// QA Manager
                "RD": "lisi",// Release Manager
                "team": "ZenTao Dev",// team name
                "acl": "open",// access control【open|private|custom】
                "whitelist": "",// whitelist
                "order": "5",// the order of the project in the list
                "deleted": "0",
                "burns": [// burndown data
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    "28"
                ],
                "hours": {
                    "totalEstimate": 28,// estimated hour
                    "totalConsumed": 21,// cost hour
                    "totalLeft": 28,// left hour
                    "progress": 42.9,// progress percentage
                    "totalReal": 49
                }
            } ],
        // the list of team members
        "teamMembers": {
            "admin": {
                "id": "9",
                "root": "2",
                "type": "project",
                "account": "admin",
                "role": "",
                "limited": "no",
                "join": "2019-11-20",
                "days": "8",
                "hours": "7.0",
                "estimate": "0.00",
                "consumed": "0.00",
                "left": "0.00",
                "order": "0",
                "totalHours": "56.0",
                "realname": "admin"
            },
            "niuqi": {
                "id": "11",
                "root": "2",
                "type": "project",
                "account": "niuqi",
                "role": "Other",
                "limited": "no",
                "join": "2019-11-20",
                "days": "8",
                "hours": "7.0",
                "estimate": "0.00",
                "consumed": "0.00",
                "left": "0.00",
                "order": "0",
                "totalHours": "56.0",
                "realname": "Niu Qi"
            },
            "wangwu": {
                "id": "12",
                "root": "2",
                "type": "project",
                "account": "wangwu",
                "role": "Dev",
                "limited": "no",
                "join": "2019-11-20",
                "days": "8",
                "hours": "7.0",
                "estimate": "0.00",
                "consumed": "0.00",
                "left": "0.00",
                "order": "0",
                "totalHours": "56.0",
                "realname": "Wang Wu"
            },
            "zhapliu": {
                "id": "10",
                "root": "2",
                "type": "project",
                "account": "zhapliu",
                "role": "QA",
                "limited": "no",
                "join": "2019-11-20",
                "days": "8",
                "hours": "7.0",
                "estimate": "0.00",
                "consumed": "0.00",
                "left": "0.00",
                "order": "0",
                "totalHours": "56.0",
                "realname": "Zhao Liu"
            }
        },
        // the user list data
        "users": {
            "_empty_": "",
            "admin": "admin",
            "lisi": "Li Si",
            "niuqi": "Niu Qi",
            "wangwu": "Wang Wu",
            "zhangsan": "Zhang San",
            "zhapliu": "Zhao Liu",
            "closed": "Closed"
        }
    }
}
{
    "status": 0,
    "msg": "error",
    "result": []
}

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