Get Task Optional Information

2020-03-24 10:49:25
John Ten
228
Last edited by John Ten on 2020-03-24 21:51:43
Summary : When adding a task, you can use this method to get the relevant information of the task.
Method Description

When adding a task, you can use this method to get the relevant information of the task.

Example
public function getTaskCreateParams()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao      = new \zentao();
    $params      = array('project' => 1);    // request parameters
    $extraFields = array('title', 'projects', 'users', 'stories', 'moduleOptionMenu', 'project');    // customize fields
    $result      = $zentao->getTaskCreateParams($params, $extraFields);
    return $result;
}
Request
GET
Method

getTaskCreateParams

Parameter
Name
Type
Required
Description
project
int Required Project ID
Result
success error
{
    "status": 1,
    "msg": "success",
    "result": {
        // the navbar of ZenTao
        "title": "ZenTao PHP-SDK - Create Task",
        // the list of all project names
        "projects": {
            "1": "ZenTao PHP-SDK"
        },
        // available users【assignees and mailto】
        "users": {
            "_empty_": "",
            "admin": "A:admin",
            "lisi": "L: Li Si",
            "niuqi": "N: Niu Qi",
            "wangwu": "W: Wang Wu",
            "zhangsan": "Z: Zhang San",
            "zhapliu": "Z: Zhao Liu"
        },
        // stories of this project【link to the project】
        "stories": {
            "1": "1: Confirm PHP-SDK stories and create PHP-SDK files (Priority:1, Estimates:4)",
            "2": "2: Develop ZenTao SDK inteface (Priority:1, Estimates:24)",
            "_empty_": ""
        },
        // modules of the project linked【link to the modules】
        "moduleOptionMenu": [
            "/",
            "/Design",
            "/Dev"
        ],
        // current project info【refer to chapter 2.7 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
        }
    }
}
{
    "status": 0,
    "msg": "error",
    "result": []
}

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