Report Bug

2020-03-24 11:00:29
John Ten
3074
Last edited by Taotao on 2020-03-25 11:37:09
Share links
Summary : Request this method to add the relevant information, such as the product, project, priority, and assignee when adding a bug.
Method Description

Request this method to add the relevant information, such as the product, project, priority, and assignee when adding a bug.

Example
public function addBug()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao = new \zentao();
    $params = array(
        'product'        => 1,
        'module'         => 2,
        'project'        => 1,
        'openedBuild'    => array('trunk', 3, 2),
        'assignedTo'     => 'lisi',
        'deadline'       => '2019-11-21',
        'type'           => 'codeerror',
        'os'             => 'windows',
        'browser'        => 'ie11',
        'title'          => 'Add test 4 for bugs',  
        'color'          => '#2dbdb2',
        'severity'       => 2,
        'pri'            => 1,
        'steps'          => 'Repro steps to describe test 4 for bugs',
        'story'          => 0,
        'task'           => 0,
        'mailto'         => array('lisi', 'Zhang San'),
        'keywords'       => 'bug4'
    );    // request parameteres
    $result = $zentao->addBug($params);
    return $result;
}

Request
POST
Method
addBug
Parameter
Name
Type
Required
Description
product
int Required
Linked Product ID
module
int
Optional
Linked Module ID
project
int
Optional
Linked Project ID
openedBuild
array Optional
Affected Build ID【Add key value for builds in single bug optional info】
assignedTo
string Optional
Assignee【username】
deadline
string
Optional
End date【format: 2019-11-11】
type
string
Optional
Bug Type【codeerror|config|install|security|performance|standard|automation|designdefect|others】
os string
Optional
Optional parameter|OS【all|windows|win10|win8|win7|vista|winxp|win2012|win2008|win2003|win2000|android|ios|wp8|wp7|symbian|linux|freebsd|osx|unix|others】
browser
string
Optional
Optional parameter|Browser【all|ie|ie11|ie10|ie9|ie8|ie7|ie6|chrome|firefox|firefox4|firefox3|firefox2|opera|oprea11|oprea10|opera9|safari|maxthon|uc|other】
title
string
Required
Bug Title
browser
string
Optional
Bug color【e.g. #2dbdb2】
severity
int
Optional
Severity【1~4】
pri
int
Optional
Priority【1~4】
steps
string
Optional
Reproduce steps
story
int
Optional
Linked Story ID
task
int
Optional
Linked Task ID
keywords
string
Optional
Bug Tags
Result
success error
{
    "status": 1,
    "msg": "success",
    "result": "Saved"
}
{
    "status": 0,
    "msg": "error",
    "result": {
        "title": [
            "『Bug Title』 should not be empty."
        ]
    }
}
Write a Comment
Comment will be posted after it is reviewed.