跟踪器项/CMDB 项
跟踪器/CMDB 项具有以下形式的 URI:"/item/{id}",其中 {id} 为内部项 ID/编号。
处理跟踪器项/CMDB 项可能十分复杂,因为每个跟踪器/类别都具有特定于用户和状态的项架构以及可选的有限状态机 (有限状态机仅支持专用的状态转变)。
获取项的分支版本 
要获取跟踪器分支上的项,可以使用此请求:
GET {itemURI}/branch/{branchId}
例如:
{GET https://hostname/cb/rest/item/9894/branch/69973}
结果与请求项时相同
获取项的特定版本 
要获取特定项的版本,可以使用此请求:
GET {itemURI}/version/{version}
提交新的顶层 CMDB 类别项 
首先,必须获取新顶层 CMDB 类别项的架构和预先初始化对象:
GET {categoryURI}/newItem
例如:
GET https://hostname/cb/rest/project/Test/category/Test Cases/newItem
响应包含以下 4 个特性:
"transition":(可选,架构:"/transition/schema") 初始状态转变,例如,
"transition": {
"uri": "/transition/27",
"tracker": {
"uri": "/category/1027",
"name": "Test Cases"
},
"name": "Create",
"descFormat": "Plain",
"toStatus": {
"id": 1,
"name": "New"
}
"item":CMDB 类别 "item" 对象,其特性已根据转变和初始状况初始化为默认值,例如,
"item": {
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Test"
},
"uri": "/category/1027",
"name": "Test Cases"
},
"status": {
"id": 1,
"name": "New"
},
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"descFormat": "Plain"
}
"type":JSON 架构,用于编辑新 CMDB 类别 "item" 的特性,例如,
"type": {
"title": "Test case",
"plural": "Test cases",
"description": "Test cases to validate and verify the product",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"version": {
"title": "Version",
"type": "integer",
"minimum": 1
},
"parent": {
"title": "Parent",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
}
},
"tracker": {
"title": "Category",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string",
"maxLength": 255
}
},
"required": [
"name"
]
},
"template": {
"title": "Template",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
},
"optionsURI": "/category/1027/newItem/field/82/options"
},
"priority": {
"title": "Priority",
"enum": [
{
"id": 5,
"name": "Lowest"
},
{
"id": 4,
"name": "Low"
},
{
"id": 3,
"name": "Normal"
},
{
"id": 2,
"name": "High"
},
{
"id": 1,
"name": "Highest"
}
]
},
"name": {
"title": "Name",
"type": "string",
"maxLength": 255
},
"status": {
"title": "Status",
"enum": [
{
"id": 1,
"name": "New"
},
{
"id": 2,
"name": "In Design"
},
{
"id": 3,
"name": "Awaiting approval"
},
{
"id": 4,
"name": "Accepted"
},
{
"id": 5,
"name": "Rejected"
},
{
"id": 6,
"name": "Outdated"
}
]
},
"type": {
"title": "Type",
"enum": [
{
"id": 1,
"name": "Folder"
},
{
"id": 2,
"name": "Compatibility"
},
{
"id": 3,
"name": "Functional"
},
{
"id": 4,
"name": "Integration"
},
{
"id": 5,
"name": "Installation"
},
{
"id": 6,
"name": "Performance"
},
{
"id": 7,
"name": "Security"
},
{
"id": 8,
"name": "Smoke"
}
]
},
"submittedAt": {
"title": "Created at",
"type": "string",
"format": "date-time"
},
"submitter": {
"title": "Created by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"modifiedAt": {
"title": "Modified at",
"type": "string",
"format": "date-time"
},
"modifier": {
"title": "Modified by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"verifies": {
"title": "Verifies",
"type": "array",
"items": {
"title": "Item",
"plural": "Items",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
}
},
"uniqueItems": true,
"optionsURI": "/category/1027/newItem/field/17/options"
},
"preAction": {
"title": "Pre-Action",
"type": "string",
"format": "Wiki"
},
"testSteps": {
"title": "Test Steps",
"type": "array",
"items": {
"type": "array",
"items": [
{
"title": "Action",
"type": "string",
"format": "Wiki"
},
{
"title": "Expected result",
"type": "string",
"format": "Wiki"
},
{
"title": "Critical?",
"type": "boolean"
}
]
}
},
"postAction": {
"title": "Post-Action",
"type": "string",
"format": "Wiki"
},
"description": {
"title": "Description",
"type": "string"
},
"descFormat": {
"title": "Description Format",
"enum": [
"Plain",
"Html",
"Wiki"
]
},
"comments": {
"title": "Comments/Attachments",
"type": "array",
"items": {
"title": "Comment/Attachment",
"plural": "Comments/Attachments",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"version": {
"title": "Version",
"type": "integer"
},
"replyTo": {
"title": "Reply To",
"description": "The parent comment where this comment is a reply to",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
}
}
},
"depth": {
"title": "Depth",
"type": "integer"
},
"createdAt": {
"title": "Created",
"type": "string",
"format": "date-time"
},
"createdBy": {
"title": "Created by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"modifiedAt": {
"title": "Modified at",
"type": "string",
"format": "date-time"
},
"modifier": {
"title": "Modified by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"comment": {
"title": "Comment",
"type": "string"
},
"commentFormat": {
"title": "Description Format",
"enum": [
"Plain",
"Html",
"Wiki"
]
},
"attachments": {
"title": "Attachments",
"type": "array",
"items": {
"title": "Attachment",
"plural": "Attachments",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"version": {
"title": "Version",
"type": "integer"
},
"name": {
"title": "File",
"type": "string"
},
"size": {
"title": "Size",
"type": "integer"
},
"modifiedAt": {
"title": "Modified at",
"type": "string",
"format": "date-time"
},
"modifier": {
"title": "Modified by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
}
}
}
}
}
},
"uniqueItems": true
},
"children": {
"title": "Children",
"type": "array",
"items": {
"title": "Item",
"plural": "Items",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
}
},
"uniqueItems": true
}
},
"required": [
"name"
]
"permissions":针对每个架构特性,定义当前用户是否可以更改/设置/编辑 "item" 的 (预设) 特性值:是 (3),否 (1),例如,
"permissions": {
"id": 1,
"parent": 3,
"tracker": 1,
"template": 3,
"priority": 3,
"name": 3,
"status": 1,
"type": 3,
"submittedAt": 1,
"submitter": 1,
"modifiedAt": 1,
"modifier": 1,
"verifies": 3,
"preAction": 3,
"testSteps": 3,
"postAction": 3,
"description": 3,
"descFormat": 3,
"comments": 3,
"children": 3
}
设置完其他所有 "item" 特性后,可通过以下方式创建 CMDB 类别 "item":
POST /item
如果没有要上传的项附件,正文将仅包含项对象,否则要创建的项必须在多部分请求名为 "body" 的部分中,并且每个附件都必须是一个额外的部分 (请参阅下面的新跟踪器项的创建示例)。
例如:创建仅包含普通备注而没有附件的项
{
"name" : "Test dimmer switch",
"tracker" : "/project/Test/category/Test Cases",
"status" : "New",
"priority" : "High",
"type" : "Functional",
"description" : "Test dimmer switch",
"descFormat" : "Plain",
"preAction" : "Prepare the test environment",
"testSteps" : [ ["Switch on", "Light is on", Boolean.TRUE, ""),
["Turn dimmer", "Its getting brighter or darker", Boolean.FALSE, ""),
["Switch off", "Light is off", Boolean.TRUE, "")
],
"postAction" : "Cleanup the test environment",
"comments" : { "comment" : "I have to test this"
}
提交新的顶层跟踪器项 
首先,必须获取新顶层跟踪器的架构和预先初始化的对象:
GET {trackerURI}/newItem
例如:
GET https://hostname/cb/rest/project/Test/tracker/Tasks/newItem
响应包含以下 4 个特性:
"transition":(可选,架构:"/transition/schema") 初始状态转变,例如,
"transition": {
"uri": "/transition/79",
"tracker": {
"uri": "/tracker/1033",
"name": "Tasks"
},
"name": "Submit",
"descFormat": "Plain",
"toStatus": {
"id": 1,
"name": "New"
}
}
"item":跟踪器项对象,其特性已根据转变和初始状况初始化为默认值,例如,
"item": {
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Test"
},
"uri": "/tracker/1033",
"name": "Tasks"
},
"status": {
"id": 1,
"name": "New"
},
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"descFormat": "Plain"
}
"type":JSON 架构,用于编辑新跟踪器 "item" 的特性,例如,
"type": {
"title": "Task",
"plural": "Tasks",
"description": "Activities that need to be accomplished within a defined period of time",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"version": {
"title": "Version",
"type": "integer",
"minimum": 1
},
"parent": {
"title": "Parent",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
}
},
"tracker": {
"title": "Tracker",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string",
"maxLength": 255
}
},
"required": [
"name"
]
},
"priority": {
"title": "Priority",
"enum": [
{
"id": 5,
"name": "Lowest"
},
{
"id": 4,
"name": "Low"
},
{
"id": 3,
"name": "Normal"
},
{
"id": 2,
"name": "High"
},
{
"id": 1,
"name": "Highest"
}
]
},
"name": {
"title": "Summary",
"type": "string",
"maxLength": 255
},
"status": {
"title": "Status",
"enum": [
{
"id": 1,
"name": "New"
},
{
"id": 2,
"name": "Suspended"
},
{
"id": 3,
"name": "In progress"
},
{
"id": 4,
"name": "Partly completed"
},
{
"id": 5,
"name": "Completed"
}
]
},
"severity": {
"title": "Severity",
"enum": [
{
"id": 1,
"name": "Blocker"
},
{
"id": 2,
"name": "Critical"
},
{
"id": 3,
"name": "Minor"
},
{
"id": 4,
"name": "Trivial"
}
]
},
"resolution": {
"title": "Resolution",
"enum": [
{
"id": 1,
"name": "Successful"
},
{
"id": 2,
"name": "Invalid"
},
{
"id": 3,
"name": "Duplicate"
}
]
},
"release": {
"title": "Release",
"type": "array",
"items": {
"title": "Item",
"plural": "Items",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
}
},
"uniqueItems": true,
"optionsURI": "/tracker/1033/newItem/field/31/options"
},
"assignedTo": {
"title": "Assigned to",
"type": "array",
"items": {
"anyOf": [
{
"title": "User",
"plural": "Accounts",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
{
"title": "Role",
"plural": "Roles",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
},
"required": [
"name"
]
}
]
},
"uniqueItems": true,
"optionsURI": "/tracker/1033/newItem/field/5/options"
},
"submittedAt": {
"title": "Submitted at",
"type": "string",
"format": "date-time"
},
"submitter": {
"title": "Submitted by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"modifiedAt": {
"title": "Modified at",
"type": "string",
"format": "date-time"
},
"modifier": {
"title": "Modified by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"startDate": {
"title": "Start Date",
"type": "string",
"format": "date-time"
},
"endDate": {
"title": "End Date",
"type": "string",
"format": "date-time"
},
"plannedEffort": {
"title": "Planned Effort",
"type": "integer",
"minimum": 0
},
"accruedMillis": {
"title": "Accrued Effort",
"type": "integer",
"minimum": 0
},
"spentEffort": {
"title": "Spent Effort",
"type": "integer",
"minimum": 0
},
"spentEstimatedHours": {
"title": "% Spent / Plan",
"type": "number"
},
"description": {
"title": "Description",
"type": "string"
},
"descFormat": {
"title": "Description Format",
"enum": [
"Plain",
"Html",
"Wiki"
]
},
"comments": {
"title": "Comments/Attachments",
"type": "array",
"items": {
"title": "Comment/Attachment",
"plural": "Comments/Attachments",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"version": {
"title": "Version",
"type": "integer"
},
"replyTo": {
"title": "Reply To",
"description": "The parent comment where this comment is a reply to",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
}
}
},
"depth": {
"title": "Depth",
"type": "integer"
},
"createdAt": {
"title": "Created",
"type": "string",
"format": "date-time"
},
"createdBy": {
"title": "Created by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"modifiedAt": {
"title": "Modified at",
"type": "string",
"format": "date-time"
},
"modifier": {
"title": "Modified by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
},
"comment": {
"title": "Comment",
"type": "string"
},
"commentFormat": {
"title": "Description Format",
"enum": [
"Plain",
"Html",
"Wiki"
]
},
"attachments": {
"title": "Attachments",
"type": "array",
"items": {
"title": "Attachment",
"plural": "Attachments",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"version": {
"title": "Version",
"type": "integer"
},
"name": {
"title": "File",
"type": "string"
},
"size": {
"title": "Size",
"type": "integer"
},
"modifiedAt": {
"title": "Modified at",
"type": "string",
"format": "date-time"
},
"modifier": {
"title": "Modified by",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "User Name",
"type": "string",
"maxLength": 40
}
},
"required": [
"name"
]
}
}
}
}
}
},
"uniqueItems": true
},
"children": {
"title": "Children",
"type": "array",
"items": {
"title": "Item",
"plural": "Items",
"type": "object",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
"name": {
"title": "Name",
"type": "string"
}
}
},
"uniqueItems": true
}
},
"required": [
"name",
"description"
]
}
"permissions":针对每个架构特性,定义当前用户是否可以更改/设置/编辑 "item" 的 (预设) 特性值:是 (3),否 (1),例如,
"permissions": {
"tracker": 1,
"priority": 3,
"name": 3,
"status": 1,
"severity": 3,
"resolution": 3,
"release": 3,
"assignedTo": 3,
"submittedAt": 1,
"submitter": 1,
"modifiedAt": 1,
"modifier": 1,
"startDate": 3,
"endDate": 3,
"plannedEffort": 3,
"spentEffort": 3,
"spentEstimatedHours": 1,
"description": 3,
"descFormat": 3,
"comments": 3
}
设置完所有其他 "item" 特性后,可通过以下方式创建跟踪器 "item":
POST /item
如果没有要上传的项附件,正文将仅包含项对象,否则要创建的项必须在多部分请求名为 "body" 的部分中,并且每个附件都必须是一个额外的部分。
例如:创建包含初始备注和两个附件的项:
POST https: //hostname/cb/rest/item
Authorization: (Data not shown)
Accept: application/json
Accept-Language: en
Content-Type: multipart/form-data; boundary=--MULTIPART-BOUNDARY--
Content-Length: 29278
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="body"
Content-type: application/json; charset=utf-8
{
"name": "Add dimmer function to light switch",
"tracker": "/project/Test/tracker/Tasks",
"status": "New",
"priority": "High",
"assignedTo": "/role/Developer",
"description": "When turning the on/off switch in the on position to the left or right, the light must get darker/brighter.",
"descFormat": "Plain",
"comments": [
{
"comment": "This is an __example__ comment with two attachments",
"commentFormat": "Wiki",
"attachments": [
{
"name": "file1.png"
},
{
"name": "file2.png"
}
]
}
]
}
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="file1.png"; filename="file1.png"
Content-Type: image/png

(Binary data not shown)
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="file2.png"; filename="file2.png"
Content-Type: image/jpg

(Binary data not shown)
----MULTIPART-BOUNDARY----
提交现有跟踪器/类别项的新子项 
首先,必须获取指定项的新子项的架构和预先初始化的对象:
GET {itemURI}/newChild
其余部分与上文中创建新顶层跟踪器/类别项相同。
编辑现有项 
对于具有有限状态机的跟踪器/类别项,编辑意味着在当前状态的上下文中更新特性。要更改状况,必须执行状态转变 (请参阅下文)。
首先,必须获取用于编辑项的架构和对象:
GET {itemURI}/edit
响应包含以下 3 个特性:
"item":要编辑的项对象,具有其当前特性值。
"type":JSON 架构,用于编辑 "item" 的特性。
"permissions":针对每个架构特性,定义当前用户是否可以更改/设置/编辑特性值:是 (3),否 (1)。
修改 "item" 特性后,可通过以下方式更新项:
PUT /item
如果没有其他要上传的附件,正文将仅包含项 URI 和要更新的特性,否则项 URI 和已更新的特性必须在多部分请求名为 "body" 的部分中,并且每个新附件都必须是一个额外的部分。
以下是更新单个字段的简单示例。
例如,GET {itemURI}/edit 将返回类似于如下所示的 JSON:
{
"item": {
"uri": "/item/1234",
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Intland Software's Scrum Template"
},
"uri": "/tracker/5678",
"name": "Requirements"
},
"name": "Test",
"status": {
"id": 1,
"name": "New"
},
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"submittedAt": "2017-04-19T13:52:42+02:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2017-04-19T13:52:42+02:00",
"description": "This is a test.",
"descFormat": "Wiki"
},
"type": {
"title": "Requirement",
"plural": "Requirements",
"description": "Requirements Specification",
"properties": {
"uri": {
"title": "URI",
"type": "string",
"format": "uri"
},
.
.
.
}
仅为了更新“说明”字段,请在 PUT /item 请求正文中发送以下 JSON。
{
"uri": "/item/1234",
"description": "This description has been updated via REST API."
}
获取项的可能状态转变 
GET {itemURI}/transitions
返回当前项状况中可能的状态转变 (架构:"/transition/schema") 的数组,例如
GET https://hostname/cb/rest/item/1000/transitions
[
{
"uri": "/transition/81",
"name": "Start",
"descFormat": "Plain"
},
{
"uri": "/transition/83",
"name": "Complete",
"descFormat": "Plain"
}
]
执行状态转变 
要对项执行状态转变,首先必须获取项的架构、预先初始化的对象以及转变目标状况:
GET {itemURI}/transition/{transitionId}
例如:
GET https://hostname/cb/rest/item/1000/transition/81
响应包含以下 4 个特性:
"transition":(架构:"/transition/schema") 请求的状态转变,例如,
"transition": {
"uri": "/transition/81",
"tracker": {
"uri": "/tracker/1033",
"name": "Tasks"
},
"name": "Start",
"descFormat": "Plain",
"fromStatus": {
"id": 1,
"name": "New"
},
"toStatus": {
"id": 3,
"name": "In progress"
}
}
"item":项对象,其中 "status" 已反映转变目标状况,并且已应用任何转变特定默认值,例如,
"item": {
"uri": "/item/1000",
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Test"
},
"uri": "/tracker/1033",
"name": "Tasks"
},
"subject": {
"uri": "/item/1002",
"name": "The light must be dimmable"
},
"priority": {
"id": 2,
"name": "High"
},
"name": "Add dimmer function to light switch",
"status": {
"id": 3,
"name": "In progress"
},
"submittedAt": "2013-03-12T14:38:06+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-12T14:38:59+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"description": "When turning the on/off switch in the on position to the left or right, the light must get darker/brighter.",
"descFormat": "Wiki",
"comments": [
{
"uri": "/item/1000/comment/1047",
"version": 1,
"depth": 0,
"createdAt": "2013-03-12T14:38:59+01:00",
"createdBy": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-12T14:38:59+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"comment": "This is an __example__ comment with two attachments",
"commentFormat": "Wiki",
"attachments": [
{
"uri": "/item/1000/attachment/1047",
"version": 1,
"name": "file1.png",
"size": 406,
"modifiedAt": "2013-03-12T14:38:59+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
}
},
{
"uri": "/item/1000/attachment/1048",
"version": 1,
"name": "file2.png",
"size": 17828,
"modifiedAt": "2013-03-12T14:38:59+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
}
}
]
}
]
}
"type":JSON 架构,用于编辑 "item" 的特性。
"permissions":针对每个架构特性,定义当前用户是否可以更改/设置/编辑特性值:是 (3),否 (1)。
在有选择地修改了其他 "item" 特性后,可通过以下方式更新跟踪器项:
PUT /item
如果没有其他要上传的附件,正文必须包含 "item" 对象,否则 "item" 对象必须在多部分请求的名为 "body" 的部分中,并且每个新附件都必须是一个额外的部分。
例如:执行带有备注的转变并添加其他附件:
PUT https: //hostname/cb/rest/item
Authorization: (Data not shown)
Accept: application/json
Accept-Language: en
Content-Type: multipart/form-data; boundary=--MULTIPART-BOUNDARY--
Content-Length: 43278
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="body"
Content-type: application/json; charset=utf-8
{
"uri": "/item/1000",
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Test"
},
"uri": "/tracker/1033",
"name": "Tasks"
},
"priority": {
"id": 1,
"name": "Highest"
},
"name": "Add dimmer function to light switch",
"status": {
"id": 3,
"name": "In progress"
},
"submittedAt": "2013-03-12T14:38:06+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-12T14:38:59+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"description": "When turning the on/off switch in the on position to the left or right, the light must get darker/brighter.",
"descFormat": "Wiki",
"comments": {
"comment": "Starting work is absolutely necessary, in order to get things done ;-)",
"commentFormat": "Plain",
"attachments": {
"name": "ToDo.doc"
}
}
}
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="ToDo.doc"; filename="ToDo.doc"
Content-Type: application/msword
(Binary data not shown)
----MULTIPART-BOUNDARY----
要添加新备注/附件,只需将其添加到上文中所示的 "attachments" 数组特性中即可。不必重新发送,(甚至可首选) 不重新发送 PUT /item 请求中的现有备注。不重新发送没有任何负面影响,因为您不能通过 PUT /item,而只能通过以下特殊要求更新或删除备注。
添加新的项备注 (加上附件) 
POST {itemURI}/comment
如果只需要添加不带附件的备注,正文将仅包含备注对象,否则备注对象必须在多部分请求的名为 "body" 的部分中,并且每个新附件都必须是一个额外的部分。
例如:添加备注,即对先前备注的回复,不带附件:
POST https://hostname/cb/rest/item/1000/comment
{
"replyTo": "/item/1000/comment/1049",
"comment": "Now, that we've got so far, we should also bring it to an end !"
}
更新现有项备注 (包括附件) 
PUT {itemURI}/comment
如果只需要修改备注,正文将仅包含备注 uri 和备注文本,否则备注对象必须在多部分请求的名为 "body" 的部分中,并且要添加或替换的每个附件都必须是一个额外的部分。例如:将图片添加到备注中,并将图片嵌入到备注文本中 (通过 Wiki 图像引用)。
PUT https: //hostname/cb/rest/item/1000/comment
Authorization: (Data not shown)
Accept: application/json
Accept-Language: en
Content-Type: multipart/form-data; boundary=--MULTIPART-BOUNDARY--
Content-Length: 43278
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="body"
Content-type: application/json; charset=utf-8
{
"uri": "/item/1000/comment/1050",
"version": 1,
"comment": "Now, that we've got so far, we should also bring it to an end ! [!cube.png!]",
"commentFormat": "Wiki",
"attachments": {
"name": "cube.png"
}
}
----MULTIPART-BOUNDARY--
Content-Disposition: form-data; name="cube.png"; filename="cube.png"
Content-Type: image/png
(Binary data not shown)
----MULTIPART-BOUNDARY----
删除现有项备注 (包括附件) 
DELETE {itemCommentURI}
这也将删除备注的所有回复 (以递归方式)。
添加新项附件 
POST {itemURI}/attachment
这是附加不带备注的文件的特殊变型。请求必须为多部分请求,每个文件附加一个部分。无 "body" 部分。
获取附加到项的文件内容 
GET {itemAttachmentURI}
例如:
GET https://hostname/cb/rest/item/1000/attachment/1047
这将返回响应正文中附加文件 (如 "file1.png") 的内容 (包括文件名和内容类型)。
获取按名称附加至项的文件内容 
也可以按名称获取项的附件,只需将附件名称用作 uri 的最后一部分即可。
例如:
GET https://hostname/cb/rest/item/1000/attachment/file1.png
这将返回响应正文中名为 "file1.png" 的附加文件的内容 (包括文件名和内容类型)。
更新附加到项的文件的内容 
PUT {itemAttachmentURI}
请求正文必须包含新的文件内容 (单一部分或具有一个部分的多部分)。
移除附加到项的文件 
REMOVE {itemAttachmentURI}
获取项的架构 
GET {itemURI}/schema
获取有关项的信息 
GET {itemURI}
获取项历史记录架构 
GET /item/history/schema
获取项的变更历史记录 
GET {itemURI}/history
例如:
GET https://hostname/cb/rest/item/1001/history
[
{
"version": 1,
"submittedAt": "2013-03-20T10:52:43+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"transition": {
"uri": "/transition/null",
"name": "Submit",
"descFormat": "Plain"
},
"changes": []
},
{
"version": 2,
"submittedAt": "2013-03-20T10:52:44+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"transition": {
"uri": "/transition/232",
"name": "Design",
"descFormat": "Plain"
},
"changes": [
{
"field": "status",
"oldValue": {
"id": 1,
"name": "New"
},
"newValue": {
"id": 2,
"name": "In Design"
}
}
]
}
]
获取项的所有子项的大纲 (自 Codebeamer 7.9.0 版本起) 
GET {itemURI}/outline[?query]
参数
类型
必需
含义
paragraph
布尔型
false
是否还要返回各个子项的段落/章节编号。默认值为 false
flat
布尔型
false
是否将大纲作为简单列表返回,其中子项直接跟在其父项之后 (值为 true 时)。
默认值为 false,这种情况下返回树。
depth
整型
false
返回的大纲/层次结构的最大深度。depth0 时,仅返回直接子项。默认值为无限制 (全深度)。
获取项的子项 
GET {itemURI}/children
与仅包含子项引用信息的项的 "children" 特性相反,这会返回指定项所有子项的完全填充对象。
获取引用某个项的其他项的汇总 
GET {itemURI}/references/summary[?query]
参数
类型
必需
含义
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为任意状况。
例如,获取引用需求 /item/1001 的项的汇总:
GET https://hostname/cb/rest/item/1001/references/summary
{
"All": [
{
"field": "Total",
"label": "Total",
"total": 2,
"open": 2,
"overTime": 0
},
{
"field": "Subject",
"label": "Subject",
"total": 1,
"open": 1,
"overTime": 0
},
{
"field": "Verifies",
"label": "Verifies",
"total": 1,
"open": 1,
"overTime": 0
}
],
"Tasks": [
{
"field": "Total",
"label": "Total",
"total": 1,
"open": 1,
"overTime": 0
},
{
"field": "Subject",
"label": "Subject",
"total": 1,
"open": 1,
"overTime": 0
}
],
"Test cases": [
{
"field": "Total",
"label": "Total",
"total": 1,
"open": 1,
"overTime": 0
},
{
"field": "Verifies",
"label": "Verifies",
"total": 1,
"open": 1,
"overTime": 0
}
]
在本示例中,有两项引用了需求:
一个测试用例 (用于“验证”需求),以及
一个任务 (其“主题”是实施需求)。
获取引用某个项的其他项 
GET {itemURI}/references[?query]
参数
类型
必需
含义
field
字符串
引用字段的名称,仅显示通过此字段引用此项的引用项。默认值为任意字段。
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为任意状况。
例如,获取通过任何字段引用需求 /item/1001 的所有项 (任意类型, 任意状况):
GET https://hostname/cb/rest/item/1001/references
[
{
"uri": "/item/1004",
"version": 1,
"field": [
"verifies"
],
"tracker": {
"uri": "/category/1027",
"name": "Test Cases"
},
"priority": {
"id": 2,
"name": "High"
},
"name": "Test dimmer switch",
"status": {
"id": 1,
"name": "New"
},
"type": {
"id": 3,
"name": "Functional"
},
"submittedAt": "2013-03-20T11:06:53+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-20T11:06:53+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"verifies": [
{
"uri": "/item/1002",
"name": "The light must be dimmable"
}
],
"preAction": "Prepare the test environment",
"testSteps": [
[
"Switch on",
"Light is on",
true
],
[
"Turn dimmer",
"Its getting brighter or darker",
false
],
[
"Switch off",
"Light is off",
true
]
],
"postAction": "Cleanup the test environment",
"description": "Test dimmer switch",
"descFormat": "Wiki"
},
{
"uri": "/item/1003",
"version": 1,
"field": [
"subject"
],
"tracker": {
"uri": "/tracker/1033",
"name": "Tasks"
},
"priority": {
"id": 2,
"name": "High"
},
"name": "Add dimmer function to light switch",
"status": {
"id": 1,
"name": "New"
},
"subject": {
"uri": "/item/1002",
"name": "The light must be dimmable"
},
"severity": {
"id": 2,
"name": "Critical"
},
"assignedTo": [
{
"uri": "/role/2",
"name": "Developer"
}
],
"submittedAt": "2013-03-20T11:04:06+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-20T11:04:06+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"description": "When turning the on/off switch in the on position to the left or right, the light must get darker/brighter.",
"descFormat": "Wiki"
}
]
获取与某个项相关的其他项 
GET {itemURI}/relatedIssues/page/{pageNo}
参数
类型
必需
含义
page
整型
要返回的结果页的编号。第一页的编号为 1。
pagesize
整型
页面大小 (以项数表示),有效范围为 [1 ..500]。默认值为 100。
获取与用户相关的所有项的汇总 
GET {userURI}/item/summary[?query]
参数
类型
必需
含义
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为任意状况。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
例如,获取直接或间接分配给用户 bond 的所有未解决错误和任务的汇总
GET https://hostname/cb/rest/user/bond/item/summary?role=assigned to&type=Bugs,Tasks&status=Unresolved
{
"Total": {
"total": 2,
"today": 0,
"tomorrow": 0,
"next7Days": 0
},
"assignedTo": {
"total": 2,
"today": 0,
"tomorrow": 0,
"next7Days": 0
}
}
按 cbQL 查询字符串获取项 
GET {queryURI}/page/{page}[?queryString]
参数
类型
必需
含义
page
整型
要返回的结果页的编号。第一页的编号为 1。
pagesize
整型
页面大小 (以项数表示),有效范围为 [1 ..500]。默认值为 100。
queryString
字符串
有效的 cbQL 查询字符串
POST {queryURI}/page/{page}
获取分配给用户的工作项的第一页:
https://hostname/cb/rest/query/page/1
请求正文:
{
"pageSize": 25,
"queryString": "assignedTo='gabor.toth'"
}
按查询 ID 获取项 
返回由 ID 号指定的查询的结果。
GET /query/{queryId}/page/{pageNo}?pagesize={pageSize}
参数
类型
必需
含义
pageNo
整型
要返回的结果页的编号。第一页的编号为 1。
pageSize
整型
页面大小 (以项数表示),有效范围为 [1 ..500]。默认值为 100。
queryId
整型
有效的 cbQL 查询 ID
例如:
https://hostname/cb/rest/query/149620/page/1?pagesize=10
获取与用户相关的项 
GET {userURI}/items/page/{page}[?query]
参数
类型
必需
含义
page
整型
要返回的结果页的编号。第一页的编号为 1。
pagesize
整型
页面大小 (以项数表示),有效范围为 [1 ..500]。默认值为 100。
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"任意状况", "已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为 "未解决"。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
例如,获取直接或间接分配给用户的所有未解决错误和任务的第一页
GET https://hostname/cb/rest/user/bond/items/page/1?role=assigned to&type=Bugs,Tasks&status=Unresolved
{
"page": 1,
"size": 100,
"total": 2,
"items": [
{
"uri": "/item/1009",
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Test"
},
"uri": "/tracker/1032",
"name": "Bugs"
},
"priority": {
"id": 5,
"name": "Lowest"
},
"name": "Documentation is not complete",
"status": {
"id": 1,
"name": "New"
},
"submittedAt": "2013-03-20T15:03:21+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-20T15:03:21+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"assignedTo": [
{
"uri": "/user/1",
"name": "bond"
}
],
"description": "Finish it!",
"descFormat": "Wiki"
},
{
"uri": "/item/1007",
"version": 1,
"tracker": {
"project": {
"uri": "/project/1",
"name": "Test"
},
"uri": "/tracker/1033",
"name": "Tasks"
},
"priority": {
"id": 2,
"name": "High"
},
"name": "Check Rest API documentation",
"status": {
"id": 1,
"name": "New"
},
"assignedTo": [
{
"uri": "/role/1",
"name": "Project Admin"
}
],
"submittedAt": "2013-03-20T15:02:31+01:00",
"submitter": {
"uri": "/user/1",
"name": "bond"
},
"modifiedAt": "2013-03-20T15:02:31+01:00",
"modifier": {
"uri": "/user/1",
"name": "bond"
},
"description": "Check Rest API documentation",
"descFormat": "Wiki"
}
]
}
获取与用户相关的所有项的汇总 (按项目分组) 
GET {userURI}/projects/item/summary[?query]
参数
类型
必需
含义
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为任意状况。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
获取与特定项目中用户相关的项的汇总 
GET {userURI}{projectURI}/item/summary[?query]
GET {projectURI}{userURI}/item/summary[?query]
参数
类型
必需
含义
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为任意状况。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
获取与特定项目中用户相关的项 
GET {userURI}{projectURI}/items/page/{page}[?query]
GET {projectURI}{userURI}/items/page/{page}[?query]
参数
类型
必需
含义
page
整型
要返回的结果页的编号。第一页的编号为 1。
pagesize
整型
页面大小 (以项数表示),有效范围为 [1 ..500]。默认值为 100。
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
type
字符串
以逗号分隔的跟踪器/CMDB (项) 类型 (ID 或名称 (单数或复数)) 列表,仅显示这些类型的引用项。默认为任意类型。
status
字符串
{"任意状况", "已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为 "未解决"。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
获取与特定跟踪器/类别中用户相关的项的汇总 
GET {userURI}{trackerURI}/item/summary[?query]
GET {trackerURI}{userURI}/item/summary[?query]
GET {userURI}{categoryURI}/item/summary[?query]
GET {categoryURI}{userURI}/item/summary[?query]
参数
类型
必需
含义
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
status
字符串
{"已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为任意状况。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
获取与特定跟踪器/类别中用户相关的项 
GET {userURI}{trackerURI}/items/page/{page}[?query]
GET {trackerURI}{userURI}/items/page/{page}[?query]
GET {userURI}{categoryURI}/items/page/{page}[?query]
GET {categoryURI}{userURI}/items/page/{page}[?query]
参数
类型
必需
含义
page
整型
要返回的结果页的编号。第一页的编号为 1。
pagesize
整型
页面大小 (以项数表示),有效范围为 [1 ..500]。默认值为 100。
role
字符串
以逗号分隔的项成员字段 (ID 或名称) 列表,这些成员字段必须引用用户 (如果 onlyDirect=true) 或引用用户所拥有的角色 (如果 onlyDirect=false),例如提交者、工作负责人、负责人或主管等。
status
字符串
{"任意状况", "已开启", "已关闭", "已解决", "未解决", "成功", "不成功"} 状况之一,仅显示具有此 (元数据) 状况的引用项。默认值为 "未解决"。
newerThan
字符串
时间戳,用于仅返回在此日期和时间之后创建/修改的项。
您可以将相对时间戳指定为 "[{This | Last [n]}] [{minute | hour | day | week | month | quarter | year}[s]]",其中 "Today" 是 "This day" 的同义词,"Yesterday" 是 "Last day" 的同义词,例如 "Last week"、"This month" 或 "Last 2 days" 等;或指定为 "hh[:mm[:ss]]";或指定为 "n {h[our] | m[in[ute]] | s[ec[ond]]}[s]",例如 "30 min" 或 "6 hours" 等。
以 ISO 8601 格式指定绝对时间戳,例如 "2013-03-12T14:38:06+01:00"。
onlyDirect
布尔型
是仅显示与用户直接相关的项 (值为 true 时),还是除此之外还会显示通过用户角色间接关联的项 (值为 false 时)。默认值为 false。
将 Wiki 标记呈现在工作/配置项上下文中的 HTML 
POST /item/{id}/wiki2html
请求正文包含要呈现的 Wiki 标记。
响应正文包含呈现的 text/html
使用此方法将项 Wiki 说明或项 Wiki 字段呈现至 HTML。
这对您有帮助吗?