Get Task List

2020-03-24 10:49:02
John Ten
3344
Last edited by Taotao on 2020-03-25 09:48:01
Share links
Summary : Call this method to get the task list in different status of a project.
Method Description Call this method to get the task list in different status of a project. Note: Change asc to desc to change the order method to descending.
Example
public function getTaskList()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao      = new \zentao();
    $params      = array('projectID' => 1, 'status' => 'all', 'orderBy' => 'pri_asc');    // request parameteres
    $extraFields = array('title', 'projects', 'project', 'products', 'tasks');    // customize fields
    $result      = $zentao->getTaskList($params, $extraFields);
    return $result;
}
Request
GET
Method

getTaskList

Parameter
Name
Type
Required
Description
projectID
int Required Project ID
status
string
Optional
Task status【all|unclosed|assignedtome|myinvolved|delayed|needconfirm|wait|doing|undone|finishedbyme|done|closed|cancel】
orderBy
string
Optional
Optional parameters|Order【name_asc|pri_asc|estimate_asc|consumed_asc】
Result
success error
{
    "status": 1,
    "msg": "success",
    "result": {
        //the navbar of ZenTao
        "title": "ZenTao PHP-SDK - Task List",
        // the list of projects added
        "projects": {
            "1": "ZenTao PHP-SDK"
        },
        // the details of the current project【Refer to the description of Get Project List】
        "project": {
            "id": "1",
            "isCat": "0",
            "catID": "0",
            "type": "sprint",
            "parent": "0",
            "name": "ZenTao PHP-SDK",
            "code": "002",
            "begin": "2019-11-11",
            "end": "2019-11-23",
            "days": "10",
            "status": "doing",
            "subStatus": "",
            "statge": "1",
            "pri": "1",
            "desc": "ZenTao PHP-SDK Dev is used to manage projects via PHPer more efficiently",
            "openedBy": "admin",
            "openedDate": "2019-11-11 15:24:14",
            "openedVersion": "11.6.4",
            "closedBy": "",
            "closedDate": "0000-00-00 00:00:00",
            "canceledBy": "",
            "canceledDate": "0000-00-00 00:00:00",
            "PO": "zhangsan",
            "PM": "niuqi",
            "QD": "admin",
            "RD": "lisi",
            "team": "ZenTao Dev",
            "acl": "open",
            "whitelist": "",
            "order": "5",
            "deleted": "0",
            "totalHours": "420.0",
            "totalEstimate": 28,
            "totalConsumed": 25,
            "totalLeft": 0
        },
        // linked product list
        "products": {
            "1": {
                "id": "1",
                "name": "ZenTao-PHP-SDK",
                "type": "normal",
                "branch": "0",
                "plan": "0"
            }
        },
        // the task list of this project
        "tasks": {
            "1": {
                "id": "1",// task ID
                "parent": "0",
                "project": "1",// linked project ID
                "module": "1",// linked module ID
                "story": "1",
                "storyVersion": "1",
                "fromBug": "0",
                "name": "Confirm PHP-SDK stories and create PHP-SDK files",// task name
                "type": "design",// task type
                "pri": "1",
                "estimate": "4",
                "consumed": "6",
                "left": "0",
                "deadline": "2019-11-11",
                "status": "done",
                "subStatus": "",
                "color": "",
                "mailto": "",
                "desc": "Create zentao.sdk.class, integrate user authentication, do story planning and start developing.",// task description
                "openedBy": "admin",// createdby
                "openedDate": "2019-11-11 15:29:27",// created time
                "assignedTo": "admin",
                "assignedDate": "2019-11-20 15:30:15",
                "estStarted": "2019-11-11",
                "realStarted": "2019-11-11",
                "finishedBy": "admin",
                "finishedDate": "2019-11-20 15:30:15",
                "finishedList": "",
                "canceledBy": "",
                "canceledDate": "0000-00-00 00:00:00",
                "closedBy": "",
                "closedDate": "0000-00-00 00:00:00",
                "closedReason": "",
                "lastEditedBy": "admin",
                "lastEditedDate": "2019-11-20 15:30:15",
                "deleted": "0",
                "storyID": "1",
                "storyTitle": "Confirm PHP-SDK sotires and create PHP-SDK files",
                "product": "1",
                "branch": "0",
                "latestStoryVersion": "1",
                "storyStatus": "active",
                "assignedToRealName": "admin",
                "needConfirm": false,
                "productType": "normal",
                "progress": 100
            }
        }
    }
}
{
    "status": 0,
    "msg": "error",
    "result": []
}

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