用户指南 > 关于用户指南 > Codebeamer DOORS Bridge > Codebeamer DOORS Bridge REST API
Codebeamer DOORS Bridge REST API
Codebeamer 具有特殊的 DOORS Bridge REST API,可用于编写脚本:
本文档仅介绍 DOORS Bridge 的特定功能。
有关说明,请参阅 REST API (v1)
获取 DOORS 层次结构的顶层节点
GET /doors/hierarchy[?options]
选项
类型
必需
含义
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
recursively
布尔型
是以递归方式获取后代项 (true),还是仅获取顶层节点 (false)? 默认值为 false。
baselineSets
布尔型
是仅显示项目和文件夹以及每个节点的基线集定义数 (true),还是显示没有基线集的项目、文件夹和 (正式) 模块 (false)? 默认值为 false。
响应包含一个 JSON 对象数组,其中每个对象表示 DOORS 层次结构中的一个项。
项的类型如下:
类型
含义
1
文件夹
2
项目
3
模块
GET /doors/hierarchy?server=http://my-doors-bridge:9090/db&username=...&password=...
[ {
"id" : "00000001",
"type" : 2,
"name" : "Klaus Test",
"description" : "Testprojekt für Tests von Klaus"
}, {
"id" : "00000002",
"type" : 1,
"name" : "Intland Software",
"description" : "Daten von Intland Software"
}, {
"id" : "00000003",
"type" : 1,
"name" : "Mechatronics",
"description" : "Merit Automotive Electronics"
}, {
"id" : "00000004",
"type" : 2,
"name" : "Test Project"
}, {
"id" : "00000005",
"type" : 2,
"name" : "ReqIF Test",
"description" : "Project to test ReqIF import/export"
} ]
获取指定 DOORS 层次结构节点的子项或后代
GET /doors/{node}/children[?options]
选项
类型
必需
含义
node
字符串
父节点的 ID,例如 "00000001"。
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
recursively
布尔型
是以递归方式获取后代项 (true),还是仅获取直接子项 (false)? 默认值为 false。
baselineSets
布尔型
是仅显示项目和文件夹以及每个节点的基线集定义数 (true),还是显示没有基线集的项目、文件夹和 (正式) 模块 (false)。默认值为 false。
响应包含一个 JSON 对象数组,其中每个对象表示 DOORS 层次结构中的一个项。
例如:
GET /doors/00000001/children?server=http://my-doors-bridge:9090/db&username=...&password=...&recursively=true

[ {
"id" : "00000020",
"type" : 3,
"name" : "Pflichtenheft",
"description" : "Ein Test Pflichenheft"
}, {
"id" : "00000021",
"type" : 1,
"name" : "Testmanagement",
"description" : "Daten für das Testmanagement",
"children" : [ {
"id" : "00000040",
"type" : 1,
"name" : "Spezifikationen",
"description" : "Testfälle und Testspezifikationen",
"children" : [ {
"id" : "00000060",
"type" : 3,
"name" : "Testfälle",
"description" : "Testfall Spezifiationen"
} ]
}, {
"id" : "00000041",
"type" : 1,
"name" : "Testprotokolle",
"description" : "Protokolle/Ergebnisse"
} ]
} ]
获取在指定的 DOORS 项目或文件夹中定义的基线集
GET /doors/{projectOrFolder}/baselineSets[?options]
选项
类型
必需
含义
projectOrFolder
字符串
DOORS 项目或文件夹的 ID,例如 "000000a0"。
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
baselines
布尔型
是还要获取每个基线集中的模块基线 (true),还是仅获取包括模块和基线集的基线集定义 (false)? 默认值为 false。
响应包含一个 JSON 对象数组,其中每个对象表示一个 DOORS 基线集定义 (包括模块和基线集)。
例如:
GET /doors/000000a0/baselineSet?server=http://my-doors-bridge:9090/db&username=...&password=...&baselines=true

[ {
"name" : "SA deliveries",
"description" : "Baselines made after each SA docs delivery",
"modules" : [ {
"id" : "00000182",
"name" : "RTD_10024803_I",
"description" : "RTD - B3",
"path" : "/Mechatronics/10024803/02_SYS_REQs/RTD_10024803_I"
}, {
"id" : "00000260",
"name" : "EETP_10024803",
"description" : "Electrical Test Specification",
"path" : "/Mechatronics/10024803/10_SYS_Test/EE/EETP_10024803"
}, {
...
} ],
"baselineSets" : [ {
"id" : "1.0.1.0",
"description" : "SA B1 delivery",
"Created On" : 1394625274,
"Created By" : "krzysztof",
"baselines" : {
"00000182" : "3.0.1.0",
"00000260" : "3.0.1.0",
...
}
}, {
...
} ]
}, {
...
} ]
获取指定 DOORS 模块的元数据 (属性和链接类型)
GET /doors/{module}/metaData[?options]
选项
类型
必需
含义
module
字符串
正式模块的 ID,例如 "00000020"。也可以是以逗号分隔的模块 ID 列表,用于获取多个模块的合并/聚合元数据。
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
响应是 JSON 对象,该对象具有指定模块的 attributes 和链接类型。
属性的类型如下:
类型
含义
0
字符串
1
整数
2
小数
3
时间戳
4
布尔值
5
用户名
6
枚举
7
引用
10
富文本
例如:
GET /doors/00000020/metaData?server=http://my-doors-bridge:9090/db&username=...&password=...
{
"id" : "00000020",
"name" : "Pflichtenheft",
"description" : "Ein Test Pflichenheft",
"locked" : true,
"attributes" : [ {
"name" : "Created By",
"type" : 5,
"memberType" : 2
}, {
"name" : "Created On",
"type" : 3
}, {
"name" : "Created Thru",
"type" : 6,
"options" : [ {
"id" : 0,
"name" : "Manual Input"
}, {
"id" : 1,
"name" : "Extracting"
}, {
"id" : 2,
"name" : "Copying"
} ],
"default" : "Manual Input"
}, {
"name" : "Last Modified By",
"type" : 5,
"memberType" : 2
}, {
"name" : "Last Modified On",
"type" : 3
}, {
"name" : "Priorität",
"description" : "Die Priorität der Anforderung",
"type" : 6,
"options" : [ {
"id" : 1,
"name" : "Nice to have",
"color" : 0
}, {
"id" : 2,
"name" : "Want to have",
"color" : 33
}, {
"id" : 3,
"name" : "Must have",
"color" : 29
} ],
"editable" : true
}, {
"name" : "Speisefolge",
"description" : "Umfang des gewünschten Menüs",
"type" : 6,
"options" : [ {
"id" : 1,
"name" : "Vorspeise"
}, {
"id" : 2,
"name" : "Suppe"
}, {
"id" : 3,
"name" : "Hauptgericht"
}, {
"id" : 4,
"name" : "Dessert"
} ],
"multiple" : true,
"editable" : true
}, {
"name" : "Status",
"description" : "Der Status der Anforderung",
"type" : 6,
"options" : [ {
"id" : 1,
"name" : "Entwurf",
"color" : 28
}, {
"id" : 3,
"name" : "Akzeptiert",
"color" : 25
}, {
"id" : 2,
"name" : "Abgelehnt",
"color" : 13
} ],
"editable" : true
}, {
"name" : "attachments",
"type" : 7,
"refType" : 5,
"refQuali" : [ "attachment" ],
"multiple" : true,
"label" : "Attachments",
"description" : "Whether to import embedded OLE objects and pictures as attachments, or only the object rich text without embedded OLE objects and pictures",
"editable" : true
}, {
"name" : "discussions",
"type" : 7,
"refType" : 5,
"refQuali" : [ "comment" ],
"multiple" : true,
"label" : "Discussions",
"description" : "Whether to also import object discussions and comments, or not. (Only possible, if users are also imported)",
"editable" : true
}, {
"name" : "history",
"type" : 7,
"refType" : 5,
"refQuali" : [ "change" ],
"multiple" : true,
"label" : "History",
"description" : "Whether to also import the object history, or not. (Only possible, if users are also imported)"
} ],
"linkTypes" : [ {
"id" : "00000022",
"name" : "DOORS Links",
"description" : "Automatisch von DOORS erstelltes Linkmodul",
"attributes" : [ {
"name" : "Created By",
"type" : 5,
"memberType" : 2
}, {
"name" : "Created On",
"type" : 3
}, {
"name" : "Last Modified By",
"type" : 5,
"memberType" : 2
}, {
"name" : "Last Modified On",
"type" : 3
} ]
}, {
"id" : "External",
"name" : "External",
"description" : "Links to external resources",
"attributes" : [ {
"name" : "Created By",
"type" : 5,
"memberType" : 2
}, {
"name" : "Created On",
"type" : 3
}, {
"name" : "Last Modified By",
"type" : 5,
"memberType" : 2
}, {
"name" : "Last Modified On",
"type" : 3
} ]
} ]
}
获取指定 DOORS 模块的 HTML 预览
GET /doors/{module}/preview[?options]
选项
类型
必需
含义
module
字符串
要预览的正式模块的 ID,例如 "00000020"。
baseline
字符串
要预览的模块基线的 (版本) ID。默认值为 null,用于显示模块的当前/ HEAD 修订版本。
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
length
整型
预览长度 (要显示的项数)。默认值为前 50 项。
响应是 UTF-8 编码格式的 HTML 片段。
例如:
GET /doors/00000020/preview?server=http://my-doors-bridge:9090/db&username=...&password=...
获取有关所有已注册 DOORS Bridge 的信息
GET / doors/bridges
您只能获取有关公开的或您具有显式访问权限的 DOORS Bridge 的信息。例如:
[ {
"id" : 12345,
"server" : "http://my-doors-bridge:9090/db",
"description" : "DOORS 9.7 Bridge",
"public" : true
} ]
获取有关特定 DOORS Bridge 的信息
GET /doors/bridge/{bridgeId}
您只能获取有关公开的或您具有显式访问权限的 DOORS Bridge 的信息。例如:
GET /doors/bridge/12345
{
"id" : 12345,
"server" : "http://my-doors-bridge:9090/db",
"description" : "DOORS 9.7 Bridge",
"public" : true
}
获取与指定 DOORS 模块关联的跟踪器
GET {CB}/rest/doors/bridge/{bridgeId}/module/{moduleId}/tracker[?options]
选项
类型
必需
含义
bridgeId
整型
模块所属 DOORS Bridge 实例的 ID。正在调用的用户必须具有对指定 /doors/bridge/{bridgeId} 的访问权限,或者网桥必须是公开的。
module
字符串
要获取关联跟踪器的正式模块的 ID,例如 "00000020"。
tracker_id
整型
可选 Codebeamer 跟踪器 ID,用于检查指定模块是否可以与此跟踪器关联。
结果是关联 Codebeamer 跟踪器的相关信息,如果指定模块未与任何跟踪器关联,结果为 null。
例如:
GET /doors/bridge/12345/module/000000a0/tracker
{
"id" : 5130,
"type" : 5,
"path" : "Tracker",
"name" : "Pflichtenheft",
"title" : "",
"project" : {
"id" : 14,
"name" : "Test"
}
}
获取指定跟踪器的 DOORS 导入设置
GET /tracker/{trackerId}/doors/settings[?options]
选项
类型
必需
含义
trackerId
整型
要获取 DOORS 导入设置的 Codebeamer 跟踪器的 ID。
version
整型
DOORS 导入历史记录日志条目的 ID,用于获取对该导入有影响的历史导入设置。
只有跟踪器管理员才能获得此信息。
结果是一个 JSON 对象,其中包含当前关联 DOOORS 模块 (如有) 的相关信息、导入配置以及用于配置导入的其他信息。
{
"id" : 83740,
"server" : {
"id" : 12345,
"server" : "http://my-doors-bridge:9090/db",
"description" : "DOORS 9.7 Bridge",
"public" : true
},
"username" : "Klaus"
"password" : "*****",
"module" : {
"id" : "00000020",
"type" : 3,
"name" : "Pflichtenheft",
"description" : "Ein Test Pflichenheft",
"path" : "/Klaus Test/Pflichtenheft",
"lock" : true,
"modify" : true
},
"enabled" : true,
"reliable" : false,
"lockModule" : true,
"linkObjects" : false,
"users" : true,
"fields" : [ {
"name" : "Created By",
"type" : 5,
"memberType" : 2,
"target" : 6
}, {
"name" : "Created On",
"type" : 3,
"target" : 4
}, {
"name" : "Last Modified By",
"type" : 5,
"memberType" : 2,
"target" : 75
},
...
],
"links" : [ {
"id" : "00000022",
"name" : "DOORS Links",
"description" : "Automatisch von DOORS erstelltes Linkmodul",
"attributes" : [ {
"name" : "Created By",
"type" : 5,
"memberType" : 2,
"target" : {
"id" : 6,
"name" : "Created by"
}
},
...
],
"target" : 1
}, {
"id" : "External",
"name" : "External",
"description" : "Links to external resources",
"attributes" : [ ... ],
"target" : 4
} ],

"interval" : "8:00h",
"log" : -1,

"userAdmin" : true,
"objectFields" : [ ... ],
"reservedFields" : [ ... ],
"dedicatedField" : { ... },
"designatedField" : { ... },
"assocTypes" : [ ... ],
"linkFields" : [ ... ]
}
信息
含义
id
此 DOORS 导入配置的 ID。
server
有关 DOORS Bridge 的信息。
username
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
module
有关关联 DOORS 模块 (如有) 的信息。
reliable
DOORS Bridge 是否应信任 DOORS 模块的历史记录:是 (true),否 (false)。
enabled
是启用还是禁用从 DOORS 模块导入到跟踪器:启用 (true),禁用 (false)。
lockModule
是否应在导入相关基线和当前 (HEAD) 修订版本之后,将 DOORS 模块锁定为 "migrated":是 (true),否 (false)。
linkObjects
是否应将 DOORS 模块中的对象链接到目标 Codebeamer 跟踪器中的迁移项:是 (true),否 (false)。
users
是否应将 DOORS 用户作为 Codebeamer 用户导入。这是导入 DOORS discussions、comments 和 history 的先决条件。
fields
这些 DOORS 模块 attributes 的数组 (应导入到目标跟踪器字段中,其中目标是跟踪器字段的 ID)。枚举字段还具有一个枚举值数组以及枚举值到目标选择选项的映射,其中目标是选择选项的 ID。
links
DOORS 模块的链接类型数组,应作为目标跟踪器项关联进行导入,其中目标是 Codebeamer 关联类型的 ID。
interval
定期导入的间隔。空白或空表示无定期导入。最小值为 10 min。
log
登录导入历史记录的最大导入次数。默认值为 -1 (全部)。首选值包括:-1、10、20、50、100、200 和 500。
响应中还包含有关目标跟踪器的以下附加信息,在显示和配置 usersfieldslinks 目标映射时需要这些信息:
信息
含义
userAdmin
您是否具有“用户 - 管理”权限 (将 DOORS 用户作为 Codebeamer 用户导入时,需要此权限)。
objectFields
这些跟踪器字段的数组 (在导入 DOORS 模块属性时,可作为目标进行关联),例如:

"objectFields" : [ {
"id" : 2,
"property" : "namedPriority",
"name" : "Business Value",
"label" : "Business Value",
"type" : 6,
"required" : false,
"multiple" : false,
"options" : [ {
"id" : 5,
"name" : "Nice to have",
"label" : "Nice to have",
"flags" : 0
}, {
"id" : 3,
"name" : "Should have",
"label" : "Should have",
"flags" : 0
}, {
"id" : 1,
"name" : "Must have",
"label" : "Must have",
"flags" : 0
} ]
}, {
"id" : 7,
"property" : "status",
"name" : "Status",
"label" : "Status",
"type" : 6,
"required" : false,
"multiple" : false,
"options" : [ {
"id" : 1,
"name" : "New",
"label" : "New",
"flags" : 0
}, {
"id" : 2,
"name" : "Draft",
"label" : "Draft",
"flags" : 64
}, {
"id" : 3,
"name" : "Waiting for approval",
"label" : "Waiting for approval",
"flags" : 4,
"style" : "#00a85d"
}, {
"id" : 4,
"name" : "Rejected",
"label" : "Rejected",
"flags" : 16,
"style" : "#ababab"
}, {
"id" : 5,
"name" : "Accepted",
"label" : "Accepted",
"flags" : 16
} ]
},
...
]
reservedFields
这些跟踪器字段的数组,不能将其与 DOORS 模块属性进行关联,并且不能将其名称用于新的自定义目标字段。
dedicatedField
有关只能与专用 DOORS 模块属性关联或根本不能关联的跟踪器字段的信息。

"dedicatedField" : {
"ForeignID" : [ "id" ],
"88" : [ "attachments" ],
"AttachmentsOnly" : [ "attachments" ],
"90" : [ "discussions" ],
"Comments" : [ "discussions" ],
"30" : [ "history" ],
"History" : [ "history" ],
"4" : [ "Created On" ],
"ForeignCreatedOn" : [ "Created On" ],
"6" : [ "Created By" ],
"ForeignCreatedBy" : [ "Created By" ],
"ForeignCreatedThru" : [ "Created Thru" ],
"74" : [ "Last Modified On" ],
"ForeignModifiedOn" : [ "Last Modified On" ],
"75" : [ "Last Modified By" ],
"ForeignModifiedBy" : [ "Last Modified By" ]
}
dedicatedField 键是跟踪器字段的 ID 或名称,值是 DOORS 属性名称的数组,此字段为专用字段。
designatedField
关于指定的自定义字段的信息 (应作为可用的目标字段提供,即使尚不存在此类 objectField)。

"designatedField" : {
"id" : {
"name" : "ForeignID",
"label" : "Foreign ID",
"description" : "The original DOORS Object Id",
"type" : 1
},
"attachments" : {
"id" : 88,
"property" : "attachments",
"name" : "AttachmentsOnly",
"label" : "Attachments",
"type" : 7,
"refType" : 5,
"refQuali" : [ "attachment" ],
"multiple" : true
},
"discussions" : {
"id" : 90,
"name" : "Comments",
"label" : "Comments",
"type" : 7,
"refType" : 5,
"refQuali" : [ "comment" ],
"multiple" : true
},
"history" : {
"id" : 30,
"property" : "milestones",
"name" : "History",
"label" : "History",
"type" : 7,
"refType" : 5,
"refQuali" : [ "change" ],
"multiple" : true
},
"Created On" : {
"name" : "ForeignCreatedOn",
"label" : "Foreign Created at",
"type" : 3
},
"Created By" : {
"name" : "ForeignCreatedBy",
"label" : "Foreign Created by",
"type" : 0,
"of" : {
"type" : 5,
"memberType" : 2
}
},
"Created Thru" : {
"name" : "ForeignCreatedThru",
"label" : "Foreign Created thru",
"type" : 6,
"options" : [ {
"name" : "Manual Input",
"label" : "Manual Input",
"flags" : 0
}, {
"name" : "Extracting",
"label" : "Extracting",
"flags" : 0
}, {
"name" : "Copying",
"label" : "Copying",
"flags" : 0
} ]
},
"Last Modified On" : {
"name" : "ForeignModifiedOn",
"label" : "Foreign Modified at",
"type" : 3
},
"Last Modified By" : {
"name" : "ForeignModifiedBy",
"label" : "Foreign Modified by",
"type" : 0,
"of" : {
"type" : 5,
"memberType" : 2
}
}
}
designatedField 键是 DOORS 属性的名称,值为指定自定义跟踪器字段的定义。
assocTypes
Codebeamer 关联类型的数组 (可作为 DOORS 链接类型目标进行关联)。

"assocTypes" : [ {
"id" : 1,
"name" : "depends"
}, {
"id" : 2,
"name" : "superordinate to"
}, {
"id" : 3,
"name" : "subordinate to"
}, {
"id" : 4,
"name" : "related"
}, {
"id" : 5,
"name" : "derived"
}, {
"id" : 6,
"name" : "violates"
}, {
"id" : 7,
"name" : "excludes"
}, {
"id" : 8,
"name" : "invalidates"
}, {
"id" : 9,
"name" : "copy of"
} ]
linkFields
预定义 Codebeamer 关联字段的数组 (可作为 DOORS 链接属性目标进行关联)。

"linkFields" : [ {
"id" : 4,
"property" : "submittedAt",
"name" : "Created at",
"label" : "Created at",
"type" : 3
}, {
"id" : 6,
"property" : "submitter",
"name" : "Created by",
"label" : "Created by",
"type" : 5,
"memberType" : 2
}, {
"id" : 74,
"property" : "modifiedAt",
"name" : "Modified at",
"label" : "Modified at",
"type" : 3
}, {
"id" : 75,
"property" : "modifier",
"name" : "Modified by",
"label" : "Modified by",
"type" : 5,
"memberType" : 2
}, {
"id" : 10000,
"property" : "customField[0]",
"name" : "Propagate suspects",
"label" : "Propagate suspects",
"description" : "Should this association be marked 'Suspected' whenever the association target is modified?",
"type" : 4
}, {
"id" : 10001,
"property" : "customField[1]",
"name" : "Suspected",
"label" : "Suspected",
"description" : "Has the association target been modified since creating/resetting this association?",
"type" : 4
}, {
"id" : 85,
"property" : "flags",
"name" : "Deleted",
"label" : "Deleted",
"type" : 1
} ]
为指定的跟踪器设置 DOORS 导入设置
PUT /tracker/{trackerId}/doors/settings
只有跟踪器管理员才能为跟踪器配置 DOORS 导入。
请求正文必须是包含以下信息的 JSON 对象 (请参阅上述说明):
ID:要更新的现有配置的 ID;如果此配置为新配置,其值为 null。
server
username
password
module
enabled
reliable (可选,默认值为 false)
lockModule (可选,默认值为 false)
linkObjects (可选,默认值为 false)
users (可选,默认值为 false)
fields (可选,默认情况下只会导入 DOORS 对象 ID、对象标题和对象文本,而所有其他 attributes 都必须在此处指定)。
links (可选,默认情况下不导入任何链接)。
interval (可选,默认情况下导入不会定期运行)。
log (可选,默认情况下记录所有导入)。
要构建 fields 和 links 映射,应使用模块的 attributes 和 linkTypes:
GET /doors/{module}/metaData[?options]
fields 映射是您要导入的这些模块 attributes 的数组,外加目标字段映射。
只能导入
discussions
和 history
如果还要导入 users,只有在您具有 userAdmin 权限的情况下才能导入。
如果要导入 users,只能将 DOORS 用户 attributes {"type": 5, "memberType" : 2} (例如,“创建者”) 分配给目标成员字段 {"type": 5, "memberType" : 2} (例如“提交者”)。有关详情,请参阅上一部分。
每个要导入的属性都必须有一个目标字段。此目标是下列两项中的任一项:
现有的 objectFields - 其类型必须与 DOORS 属性兼容。
dedicatedFields - 只能将其分配给特定属性,也可能根本无法分配,具体取决于兼容性。
示例

"target" : {
"id" : ...
}
如果未预定义合适的目标字段,会以指定名称创建一个新的自定义字段:

"target" : {
"name" : "XXX"
}
新目标字段的名称 XXX 在跟踪器中必须唯一,因此不能是
任何现有 objectFieldsreservedFieldsdesignatedFields 的特性、名称和标签,也不能是任何其他属性目标的名称。
属性目标字段映射必须唯一。不能将两个 DOORS attributes 映射到同一个目标字段。
如果要导入的属性是枚举,还必须映射属性的枚举值 (选项)。
枚举值的目标必须是属性目标选择字段的现有选项之一,或具有指定名称的新选择选项。
新目标选择选项的名称在目标选择字段中必须唯一,因此不能是
目标选择字段的任何现有选项的名称或标签,也不能是
任何其他枚举值目标的名称 (对于相同的枚举属性)。
每个目标字段的选择选项目标映射必须唯一。相同 DOORS 属性的两个枚举值不能映射到目标字段的同一个选择选项。
links 映射是一个由要导入的模块 linkTypes 与目标关联类型映射构成的数组。
链接类型的目标必须是预定义的 assocTypes 之一。不能为链接定义新目标。
链接目标关联映射必须唯一。不能将两个 DOORS 链接类型 (外部链接除外) 映射到同一个目标关联类型。
要导入的链接的 attributes 必须采用与对象 attributes 相同的方式进行映射。
移除指定跟踪器的 DOORS 导入设置
DELETE /tracker/{trackerId}/doors/settings
只有跟踪器管理员才能删除跟踪器的 DOORS 导入。
为成批/批量 DOORS 模块创建目标跟踪器并配置 DOORS 导入
如果要将 DOORS 模块导入到 Codebeamer 项目中,但尚不存在合适的目标跟踪器,该怎么做?
您可以通过以下方法,为成批/批量 DOORS 模块创建新的目标跟踪器并配置 DOORS 导入:
POST /project/{projIdOrName}/doors/modules
您必须为指定项目中的跟踪器管理员。请求正文必须是包含以下信息的 JSON 对象 (请参阅上述说明):
server
username
password
modules
template
enabled
reliable (可选,默认值为 false)。
lockModule (可选,默认值为 false)。
linkObjects (可选,默认值为 false)。
users (可选,默认值为 false)。
fields (可选,默认情况下只会导入 DOORS 对象 ID、对象标题和对象文本,而所有其他 attributes 都必须在此处指定)。
links (可选,默认情况下不导入任何链接)。
interval (可选,默认情况下导入不会定期运行)。
log (可选,默认情况下记录所有导入)。
信息
含义
server
至少具有 DOORS Bridge 的 ID 的 JSON 对象。
username
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
modules
DOORS 模块的数组 (在指定项目中为其创建目标跟踪器)。将从相应的模块中复制每个跟踪器的名称和说明。
template
要使用的模板跟踪器,或用于定义要使用的跟踪器类型的 JSON 对象。
reliable
DOORS Bridge 是否应信任 DOORS 模块的历史记录:是 (true),否 (false)。
enabled
是启用还是禁用从 DOORS 模块导入到跟踪器:启用 (true),禁用 (false)。
lockModule
是否应在导入相关基线和当前 (HEAD) 修订版本之后,将 DOORS 模块锁定为 "migrated":是 (true),否 (false)。
linkObjects
是否应将 DOORS 模块中的对象链接到目标 Codebeamer 跟踪器中的迁移项:是 (true),否 (false)。
users
是否应将 DOORS 用户作为 Codebeamer 用户导入。这是导入 DOORS discussions、comments 和 history 的先决条件。
fields
这些 DOORS 模块 attributes 的数组 (应导入到目标跟踪器字段中,其中目标是跟踪器字段的 ID)。枚举字段还具有一个枚举值数组以及枚举值到目标选择选项的映射,其中目标是选择选项的 ID。
链接
DOORS 模块的链接类型数组,应作为目标跟踪器项关联进行导入,其中目标是 Codebeamer 关联类型的 ID。
interval
定期导入的间隔。空白/空表示无定期导入。最小值为 "10 min"。
log
登录导入历史记录的最大导入次数。默认值为 -1 (全部)。首选值包括:-1、10、20、50、100、200 和 500。
批处理中的所有模块都应包含相同类型的对象,例如“需求”,因为您只能为新的目标跟踪器指定一个模板。
要了解哪些模板跟踪器和跟踪器类型可用于指定项目中的新 DOORS 导入目标跟踪器,请使用:
GET /project/{projIdOrName}/doors/trackerTemplate
此请求在下面进行了进一步记录。
您必须选择其中一个可用的模板跟踪器,例如:

"template" : {
"id" : <template id>,
"inherit" : true
}
其中,<模板 ID> 是模板的 ID,inherit 应为 true 以继承模板配置,或应为 false 以复制模板配置。
或者,您必须指定新跟踪器的类型,例如:

"template" : {
"type" : {
"id" : 5,
"name" : "Requirement"
}
}
要构建 fieldslinks 配置,必须通过以下 API 端点获取所有模块的合并/聚合元数据:
GET /doors/{module}/metaData[?options]
其中,{module} 应为逗号分隔列表,包含所有模块的 ID。
要获取有关选定目标模板的已定义、专用、指定、保留和关联字段,以及关联类型的必要信息,请使用
POST /project/{projIdOrName}/doors/trackerTemplate
其中请求正文必须是选定的模板。
对于每个模块及其新的关联目标跟踪器,将仅使用与模块相关的 fields 和 links 来构建跟踪器配置。
结果是一个 JSON 对象,其中包含每个指定模块 (每个模块 ID) 的结果。两者之一:
新建和关联的跟踪器,或
创建或配置跟踪器时发生的异常
从此处开始,您必须单独针对每个跟踪器执行 GETPUTDELETE /tracker/{trackerId}/doors/settings
获取有关下次从关联的 DOORS 模块 (如有) 中导入指定跟踪器的信息
GET /tracker/{trackerId}/doors/import
您必须具有跟踪器的“项 - 添加”权限。
结果是一个包含以下信息的 JSON 对象:

{
"tracker" : {
"id" : 139792,
"type" : 5,
"name" : "Pflichtenheft",
"project" : {
"id" : 34,
"name" : "Test"
}
},
"admin" : true,
"server" : {
"id" : 12345,
"server" : "http://my-doors-bridge:9090/db",
"description" : "DOORS 9.7 Bridge",
"public" : true
},
"connection" : {
"server" : {
"id" : 12345,
"server" : "http://my-doors-bridge:9090/db",
"description" : "DOORS 9.7 Bridge",
"public" : true
},
"username" : "Klaus",
"password" : "***"
},
"module" : {
"id" : "00000020",
"name" : "Pflichtenheft",
"description" : "Ein Test Pflichenheft",
"path" : "/Klaus Test/Pflichtenheft",
"Last Modified On" : 1516292954,
"Last Modified By" : "Klaus",
"lockModule" : true,
"linkObjects" : true,
"baselines" : [ {
"id" : "0.1",
"description" : "Initialer Stand",
"Created On" : 1489143458020,
"Created By" : "Klaus",
"createdAt" : "Mär 10 2017 11:57"
}, {
"id" : "0.2",
"description" : "Zweiter Stand",
"Created On" : 1491820027020,
"Created By" : "Klaus",
"createdAt" : "Apr 10 2017 12:27"
} ],
"lastModifiedAt" : "Jan 18 17:29"
},
"enabled" : true,
"lastImport" : {
"date" : ...
}, "nextSync" : {
"direction" : null,
"date" : null
}
}
信息
含义
tracker
关于目标跟踪器的信息。
admin
您是否具有“跟踪器 - 管理”权限。
server
JSON 对象,其中包含有关 DOORS Bridge 的信息。
connection
与 DOORS Bridge 的连接 (server、username 和 password)。
module
要从中导入的 DOORS 模块,其中包括可导入的 baselines (已导入或无法再次导入的基线,此处未列出)。
lastImport
有关上次导入 (如有) 的信息。
enabled
是启用还是禁用从 DOORS 模块导入到跟踪器:启用 (true),禁用 (false)。
nextSync
有关下次排期导入 (如有) 的信息。
从关联的 DOORS 模块 (如有) 执行到指定跟踪器中的新导入操作
POST /tracker/{trackerId}/doors/import
您必须具有跟踪器的“项 - 添加”权限。
请求正文必须是 JSON 对象,您可在其中指定要导入的可选基线,以及是否应通过跟踪器基线对基线进行镜像:

{
"baseline" : "0.1",
"mirroring" : true
}
在 Codebeamer 9.4 版本及更新版本中,只有在导入模块的当前/HEAD 修订版本时,以及只有在模块允许锁定模块和链接对象时,才可以有选择地请求锁定模块,以及有选择地将对象链接到导入的跟踪器项:

{
"lockModule" : true,
"linkObjects" : true
}
响应正文包含有关已导入 DOORS 对象的统计信息。请参阅以下历史记录中的导入统计信息。
获取跟踪器的 DOORS 导入历史记录
GET /tracker/{trackerId}/doors/history[?options]
选项
类型
必需
含义
trackerId
整型
跟踪器的 ID
page
整型
要获取的历史记录页面,从 1 开始。默认值为 1 (第一页)
pagesize
整型
每页返回的历史记录条目 (导入项) 数量。默认值为 25。最大值为 500。
响应包含跟踪器 DOORS 导入历史记录中的请求页面,例如:

{
"page" : 1,
"size" : 25,
"total" : 4,
"list" : [ {
"version" : 3,
"date" : "Heute 17:01",
"user" : {
"id" : 1,
"name" : "bond",
"realName" : "Default System Administrator"
},
"sync" : 1,
"baseline" : {
"id" : "0.2",
"date" : 1491820026993
},
"import" : {
"objects" : {
"imported" : 0,
"updated" : 6,
"updatedItems" : [ {
"id" : 7032,
"description" : "<span class='wikiContent'>Das ist ein <b>Beispiel</b>-Pflichtenheft zum Test des erweiterten Excel-Exports<br />\n<br /></span>",
"remote" : {
"id" : 16
},
"changes" : [ {
"fieldId" : 2,
"fieldName" : "Relevanz",
"oldValue" : "--",
"newValue" : "Wäre schön"
}, {
"fieldId" : 7,
"fieldName" : "Status",
"oldValue" : "--",
"newValue" : "Entwurf"
}, {
"fieldId" : 90,
"fieldName" : "Kommentar",
"op" : "Add",
"newValue" : "Weitere"
} ]
},
...
],
"deleted" : 0,
"failed" : 0
},
"history" : {
"imported" : 21,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
},
"links" : {
"imported" : 1,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
},
"baselines" : {
"imported" : 1,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
}
},
}, {
"version" : 2,
"date" : "Heute 17:00",
"user" : {
"id" : 1,
"name" : "bond",
"realName" : "Default System Administrator"
},
"sync" : 1,
"baseline" : {
"id" : "0.1",
"date" : 1489143458006
},
"import" : {
"objects" : {
"imported" : 13,
"updated" : 0,
"deleted" : 0,
"failed" : 0
},
"history" : {
"imported" : 39,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
},
"discussions" : {
"imported" : 2,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
},
"comments" : {
"imported" : 4,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
},
"attachments" : {
"imported" : 5,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
},
"baselines" : {
"imported" : 1,
"updated" : 0,
"deleted" : 0,
"failed" : 0,
"empty" : false
}
},
} ]
}
历史记录按降序排列。第一页包含最新导入信息。
有关第一次/初始/完整导入的统计信息仅包含数字。
有关增量导入的统计信息也包含有关新导入项和更新项的信息,包括每个字段的变更。
获取有关指定项目中新 DOORS 导入目标跟踪器的可用模板跟踪器和跟踪器类型的信息
GET /project/{projIdOrName}/doors/trackerTemplate
选项
类型
必需
含义
projIdOrName
字符串
Codebeamer 项目的 ID 或名称,用于从中创建新的跟踪器。
您必须为指定项目中的跟踪器管理员。
响应正文包含 DOORS 导入目标跟踪器的可能 types 和 templates:

{
"types" : [ ... ],
"templates" : [ ... ]
}
获取有关指定的导入目标模板中已定义、专用、指定、保留和关联字段以及关联类型的信息
POST /project/{projIdOrName}/doors/trackerTemplate
您必须是指定项目中的跟踪器管理员。
请求正文必须包含一个 JSON 对象,该对象可以是要使用的模板跟踪器,也可以定义要使用的跟踪器类型,例如:

{
"type" : {
"id" : 5,
"name" : "Requirement"
}
}
结果是一个 JSON 对象,其中包含指定模板跟踪器或指定类型跟踪器的相关信息:

{
"enabled" : true,
"userAdmin" : true,
"objectFields" : [ ... ],
"reservedFields" : [ ... ],
"dedicatedField" : { ... },
"designatedField" : { ... },
"assocTypes" : [ ... ],
"linkFields" : [ ... ]
}
信息
含义
enabled
是启用还是禁用从 DOORS 模块导入到跟踪器:启用 (true),禁用 (false)。
userAdmin
您是否具有“用户 - 管理”权限 (将 DOORS 用户作为 Codebeamer 用户导入时,需要此权限)。
objectFields
这些跟踪器字段的数组 (在导入 DOORS 模块 attributes 时,可作为目标进行关联),例如:

"objectFields" : [ {
"id" : 2,
"property" : "namedPriority",
"name" : "Business Value",
"label" : "Business Value",
"type" : 6,
"required" : false,
"multiple" : false,
"options" : [ {
"id" : 5,
"name" : "Nice to have",
"label" : "Nice to have",
"flags" : 0
}, {
"id" : 3,
"name" : "Should have",
"label" : "Should have",
"flags" : 0
}, {
"id" : 1,
"name" : "Must have",
"label" : "Must have",
"flags" : 0
} ]
}, {
"id" : 7,
"property" : "status",
"name" : "Status",
"label" : "Status",
"type" : 6,
"required" : false,
"multiple" : false,
"options" : [ {
"id" : 1,
"name" : "New",
"label" : "New",
"flags" : 0
}, {
"id" : 2,
"name" : "Draft",
"label" : "Draft",
"flags" : 64
}, {
"id" : 3,
"name" : "Waiting for approval",
"label" : "Waiting for approval",
"flags" : 4,
"style" : "#00a85d"
}, {
"id" : 4,
"name" : "Rejected",
"label" : "Rejected",
"flags" : 16,
"style" : "#ababab"
}, {
"id" : 5,
"name" : "Accepted",
"label" : "Accepted",
"flags" : 16
} ]
},
...
]
reservedFields
这些跟踪器字段的数组 (不能与 DOORS 模块 attributes 进行关联,且其名称不能用于新的自定义目标字段)。
dedicatedField
关于这些跟踪器字段的信息 (只能与专用 DOORS 模块 attributes 进行关联,或根本不能进行关联)。

"dedicatedField" : {
"ForeignID" : [ "id" ],
"88" : [ "attachments" ],
"AttachmentsOnly" : [ "attachments" ],
"90" : [ "discussions" ],
"Comments" : [ "discussions" ],
"30" : [ "history" ],
"History" : [ "history" ],
"4" : [ "Created On" ],
"ForeignCreatedOn" : [ "Created On" ],
"6" : [ "Created By" ],
"ForeignCreatedBy" : [ "Created By" ],
"ForeignCreatedThru" : [ "Created Thru" ],
"74" : [ "Last Modified On" ],
"ForeignModifiedOn" : [ "Last Modified On" ],
"75" : [ "Last Modified By" ],
"ForeignModifiedBy" : [ "Last Modified By" ]
}
dedicatedField 键是跟踪器字段的 ID 或名称,值是 DOORS 属性名称的数组,此字段为专用字段。
designatedField
关于指定的自定义字段的信息 (应作为可用的目标字段提供,即使尚不存在此类 objectField)。

"designatedField" : {
"id" : {
"name" : "ForeignID",
"label" : "Foreign ID",
"description" : "The original DOORS Object Id",
"type" : 1
},
"attachments" : {
"id" : 88,
"property" : "attachments",
"name" : "AttachmentsOnly",
"label" : "Attachments",
"type" : 7,
"refType" : 5,
"refQuali" : [ "attachment" ],
"multiple" : true
},
"discussions" : {
"id" : 90,
"name" : "Comments",
"label" : "Comments",
"type" : 7,
"refType" : 5,
"refQuali" : [ "comment" ],
"multiple" : true
},
"history" : {
"id" : 30,
"property" : "milestones",
"name" : "History",
"label" : "History",
"type" : 7,
"refType" : 5,
"refQuali" : [ "change" ],
"multiple" : true
},
"Created On" : {
"name" : "ForeignCreatedOn",
"label" : "Foreign Created at",
"type" : 3
},
"Created By" : {
"name" : "ForeignCreatedBy",
"label" : "Foreign Created by",
"type" : 0,
"of" : {
"type" : 5,
"memberType" : 2
}
},
"Created Thru" : {
"name" : "ForeignCreatedThru",
"label" : "Foreign Created thru",
"type" : 6,
"options" : [ {
"name" : "Manual Input",
"label" : "Manual Input",
"flags" : 0
}, {
"name" : "Extracting",
"label" : "Extracting",
"flags" : 0
}, {
"name" : "Copying",
"label" : "Copying",
"flags" : 0
} ]
},
"Last Modified On" : {
"name" : "ForeignModifiedOn",
"label" : "Foreign Modified at",
"type" : 3
},
"Last Modified By" : {
"name" : "ForeignModifiedBy",
"label" : "Foreign Modified by",
"type" : 0,
"of" : {
"type" : 5,
"memberType" : 2
}
}
}
designatedField 键是 DOORS 属性的名称,值为指定自定义跟踪器字段的定义。
assocTypes
Codebeamer 关联类型的数组 (可作为 DOORS 链接类型目标进行关联)。

"assocTypes" : [ {
"id" : 1,
"name" : "depends"
}, {
"id" : 2,
"name" : "superordinate to"
}, {
"id" : 3,
"name" : "subordinate to"
}, {
"id" : 4,
"name" : "related"
}, {
"id" : 5,
"name" : "derived"
}, {
"id" : 6,
"name" : "violates"
}, {
"id" : 7,
"name" : "excludes"
}, {
"id" : 8,
"name" : "invalidates"
}, {
"id" : 9,
"name" : "copy of"
} ]
linkFields
预定义 Codebeamer 关联字段的数组,可作为 DOORS 链接属性目标进行关联。

"linkFields" : [ {
"id" : 4,
"property" : "submittedAt",
"name" : "Created at",
"label" : "Created at",
"type" : 3
}, {
"id" : 6,
"property" : "submitter",
"name" : "Created by",
"label" : "Created by",
"type" : 5,
"memberType" : 2
}, {
"id" : 74,
"property" : "modifiedAt",
"name" : "Modified at",
"label" : "Modified at",
"type" : 3
}, {
"id" : 75,
"property" : "modifier",
"name" : "Modified by",
"label" : "Modified by",
"type" : 5,
"memberType" : 2
}, {
"id" : 10000,
"property" : "customField[0]",
"name" : "Propagate suspects",
"label" : "Propagate suspects",
"description" : "Should this association be marked 'Suspected' whenever the association target is modified?",
"type" : 4
}, {
"id" : 10001,
"property" : "customField[1]",
"name" : "Suspected",
"label" : "Suspected",
"description" : "Has the association target been modified since creating/resetting this association?",
"type" : 4
}, {
"id" : 85,
"property" : "flags",
"name" : "Deleted",
"label" : "Deleted",
"type" : 1
} ]
获取与指定 DOORS 项目或文件夹关联的项目
GET /doors/bridge/{bridgeId}/folder/{projectOrFolder}/project[?options]
选项
类型
必需
含义
bridgeId
整型
projectOrFolder 所属 DOORS Bridge 实例的 ID。正在调用的用户必须具有对指定 /doors/bridge/{bridgeId} 的访问权限,或者网桥必须是公开的。
projectOrFolder
字符串
DOORS 项目或文件夹的 ID,例如 "000000a0"。
proj_id
整型
可选的 Codebeamer 项目 ID,用于检查指定 DOORS 项目或文件夹是否可以与此项目关联。
结果是关联 Codebeamer 项目的相关信息,如果指定 DOORS 项目或文件夹未与任何项目关联,则结果为 null。
获取与指定项目关联的 DOORS 项目或文件夹
GET /project/{projIdOrName}/doors/settings
选项
类型
必需
含义
projIdOrName
字符串
要获取其关联 DOORS 项目或文件夹的 Codebeamer 项目的 ID 或名称。
只有项目管理员才能获得此信息。
结果是一个 JSON 对象,其中包含当前关联的 DOORS 项目或文件夹 (如有) 的相关信息:

{
"server" : {
"id" : 12345,
"server" : "http://my-doors-bridge:9090/db",
"description" : "DOORS 9.7 Bridge",
"public" : true
},
"username" : "Klaus",
"password" : "**",
"module" : {
"id" : "000000a1",
"type" : 2,
"name" : "Raw_Project_2",
"description" : "Just technical testing",
"path" : "/Mechatronics/Raw_Project_2"
}
}
"module" 是关联的 DOORS 项目或文件夹 (而非模块)。
设置与指定项目关联的 DOORS 项目或文件夹
PUT /project/{projIdOrName}/doors/settings
只有项目管理员才能执行此操作。
请求正文必须是 JSON 对象 (请参阅上文)。
获取有关指定 DOORS 项目/文件夹中定义的基线集的信息,可将其导入到指定项目中
GET /doors/bridge/{bridgeId}/folder/{projectOrFolder}/baselineSets/project/{projIdOrName}[?options]
GET /project/{projIdOrName}/doors/bridge/{bridgeId}/folder/{projectOrFolder}/baselineSets[?options]
选项
类型
必需
含义
beidgeId
整型
projectOrFolder 所属的 DOORS Bridge 实例的 ID。正在调用的用户必须具有对指定 /doors/bridge/{bridgeId} 的访问权限,或者网桥必须是公开的。
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
projectOrFolder
字符串
要导入其已定义基线集的 DOORS 项目或文件夹的 ID。
projIdOrName
字符串
要从中导入 (指定 DOORS 项目/文件夹中定义的) 基线集的 Codebeamer 项目的 ID 或名称。
您必须为指定项目中的跟踪器管理员。
例如:
GET /project/Test/doors/bridge/12345/folder/000000a1/baselineSets?username=...&password=...
响应中包含具有以下信息的 JSON 对象:

{
"project" : {
"id" : 34,
"name" : "Test"
},
"trackers" : [ ... ],
"baselineSets" : [ {
"id" : "1.0.A-Sample",
"description" : "",
"Created On" : 1511964226905,
"Created By" : "Administrator",
"baselines" : {
"00000580" : "1.0.A-Sample",
"00000581" : "1.0.A-Sample"
},
"definition" : {
"name" : "BLSD_0",
"description" : "script generated set definition for 'A-Sample'"
},
"date" : 1511964895905,
"createdAt" : "Nov 29 2017 15:03",
"status" : "importable"
}, {
"id" : "1.0.B-Sample",
"description" : "",
"Created On" : 1511964240905,
"Created By" : "Administrator",
"baselines" : {
"00000580" : "2.0.B-Sample",
"00000581" : "2.0.B-Sample"
},
"definition" : {
"name" : "BLSD_1",
"description" : "script generated set definition for 'B-Sample'"
},
"date" : 1511965078905,
"createdAt" : "Nov 29 2017 15:04",
"status" : "importable"
}, {
"id" : "1.0.C-Sample",
"description" : "Administrator created set @ 29.11.2017 15:04:03",
"Created On" : 1511964249905,
"Created By" : "Administrator",
"baselines" : {
"00000580" : "3.0.C-Sample"
},
"definition" : {
"name" : "BLSD_2",
"description" : "script generated set definition for 'C-Sample'"
},
"date" : 1517317172905,
"createdAt" : "Nov 29 2017 15:04",
"status" : "importable"
}, {
"id" : "HEAD",
"Created By" : "System",
"Created On" : 1519123868444,
"baselines" : {
"00000580" : null,
"00000581" : null
},
"date" : 9223372036854775807,
"definition" : {
"name" : "Projekt/Ordner",
"description" : "Dies ist eine automatisch generierte Pseudo-Baselinegruppen-Definition, die alle (formalen) Module in dem ausgewählten DOORS Projekt/Ordner umfasst."
},
"description" : "Die aktuellen Versionen aller (formalen) Module in dem ausgewählten DOORS Projekt/Ordner",
"createdAt" : "Jetzt",
"status" : "importable"
} ],
"modules" : {
"00000580" : {
"id" : "00000580",
"name" : "RS",
"path" : "/Mechatronics/Raw_Project_2/RS",
"tracker" : {
"id" : 139791,
"type" : 5,
"name" : "Lastenheft",
"project" : {
"id" : 34,
"name" : "Test"
}
}
},
"00000581" : {
"id" : "00000581",
"name" : "TD",
"path" : "/Mechatronics/Raw_Project_2/TD"
}
}
}
信息
含义
project
项目的 ID 和名称。
trackers
项目跟踪器的数组,可能是 DOORS 导入目标,但尚未与 DOORS 模块关联。
baselineSets
DOORS 基线集 (按日期排序) 的数组。
modules
JSON 对象,用作基线集中引用的所有模块的查找映射。
有关每个基线集的信息:
definition
基线集定义的名称和说明
baselines
JSON 对象,用于指定此基线集中包含的所有模块的基线/版本 ID (每个模块 ID)。
date
此基线集的锚点/引用日期:这是基线集或其中所包括任意基线的最新创建日期。
status
此基线集的导入状况
importable
imported
blocked
blockers
仅限状况为 blocked 的基线集:JSON 对象,用于指定所有模块的基线/版本 ID,可阻止此基线集的导入。
imported
仅限状况为 imported 的基线集:关于导入的信息。
mapping
仅限状况为 imported 的基线集:JSON 对象,用于在导入时指定 DOORS 模块 (ID) 到目标 Codebeamer 跟踪器的映射。
* 
Codebeamer 会自动将伪基线集 "Project or Folder" 添加到 baselineSets,其基线是 DOORS 项目或文件夹中所有模块的当前或 HEAD 修订版本 (递归),无论这些模块是否也包括在实际的 DOORS 基线集中,或者根本没有 DOORS 基线集。
获取 (正式) DOORS 模块中的对象 (在特定基线中)
GET {DB}/module/{id}/objects[?options]
POST {DB}/module/{id}/objects
选项
类型
必需
含义
id
字符串
正式模块的 ID (用于获取其对象/内容)。
baseline
字符串
模块基线的 (版本) ID (用于获取该基线中的对象)。默认值为 null (用于获取当前模块修订版本的对象)。
attributes
字符串
要返回的对象属性名称的逗号分隔列表。始终返回默认/隐式对象属性,但必须在此处显式请求所有其他属性。还有一些特殊选项,必须将这些选项指定为 (伪) 属性:
选项
含义
users
是否应返回所返回对象中引用的所有 (不同) 用户的其他信息,例如:
"users" : [ { "id" : "0000000000000002", "name" : "Klaus", "fullName" : "Klaus Mehling", "email" : "[email protected]" } ]
preview
如果存在该选项 (但不请求任何 attachments),嵌入在 DOORS 富文本中的 OLE 对象将仅由转换后的 Wiki 标记中的预览图像链接表示,例如:
text" : "[{Image src='DP2/O18-T1-1.png' }]\\\\ Ambulanz\\\\ @Copyright __Intland Software Gmbh__ 2017, ''All rights reseved''\\\\ \\\\ "
其中,
[{Image src='..'}]
引用相对图像 URN。要通过 REST API 下载预览图像,必须将此 URN 展开为完整的 REST API 附件 URL:{DB}/attachment/{URN},例如:
GET {DB}/attachment/DP2/O18-T1-1.png
attachments
如果存在该选项,会提取嵌入在 DOORS 富文本中的 OLE 对象,并将其作为单独的对象附件返回,例如:
"attachments": {
"1-1.doc": "DP2/O18-T1-1.doc",
"1-1.png": "DP2/O18-T1-1.png"
}
对于本身不是图像的嵌入 OLE 对象 (例如 1-1.doc),还将提供一个附加预览图像作为附加附件 (例如 1-1.png)。附件的键是附件名称,附件的值是附件 URN。要下载附件,必须将附件 URN 展开为完整的 REST API 附件 URL:{DB}/attachment/{URN},例如:
GET {DB}/attachment/DP2/O18-T1-1.doc
在 Wiki 标记中,嵌入 OLE 对象的位置将被替换为表单 [<附件名称>|! <预览图像>! ] 的链接,其中 <附件名称><预览图像> 是相应对象 attachments 的名称,例如:
"text": "[1-1.doc|!1-1.png!]\\\\ Ambulanz\\\\ @Copyright __Intland
Software Gmbh__ 2017, ''All rights reseved''\\\\ \\\\
"
discussions
如果存在该选项,还会返回对象 discussions 和 comments,例如:
"discussions": [
{
"name": "Improvements",
"status": "Open",
"Created On": 1488296724,
"Created By": "Klaus",
"comments": [
{
"date": 1488296724,
"author": "Klaus",
"text": "Yes, but via Wiki markup, not RTF !"
},
{
"date": 1488297333,
"author": "Klaus",
"text": "Do we support Rich Text ?"
}
]
}
]
history
如果存在该选项,还会返回有关隐式/默认和显式请求对象属性变更的历史记录,例如:
"history": [
{
"date": 1487244491,
"author": "Klaus",
"action": "createObject"
},
{
"date": 1487331196,
"author": "Klaus",
"action": "modifyObject",
"attribute": "text",
"old": "Das ist ein __Beispiel__-Pflichtenheft ...\\\\
\\\\ ", "new" : "Das ist ein __Beispiel__-Pflichtenheft zum
Test des erweiterten Excel-Exports\\\\ \\\\ " } ]
outline
如果指定 modifiedAfter 时间戳 (请参阅下文),只应返回晚于此时间点而创建或修改的对象。但是,如果修改对象链接或将对象移到其他位置,DOORS 不会更改 Last Modified On 时间戳。尤其对于处于移动对象的新旧位置之间的对象,更是如此。通过请求 outline,DOORS Bridge 将以正确的顺序返回模块中 的所有对象,及其相应的父项和位置。但对于 Last Modified On 时间戳早于 modifiedAfter 的对象,仅会返回有限的大纲信息,例如:
{
"id": 17,
"type": 2,
"pid": 13,
"pos": 1,
"outline": true
},
baseline
此选项的工作原理与上述 outline 类似,但会强制返回有关所有对象的完整信息,即使其 Last Modified On 时间戳早于 modifiedAfter 也是如此。如果您信任 DOORS 模块的历史记录,仅使用 baseline 而不是 outline!
links
字符串
要返回的对象链接的分号分隔列表:<链接类型>[:<属性>][...]
<链接类型> 是链接类型的 ID;
<属性> 是要返回的链接属性名称的逗号分隔列表。
例如:
links=00000022:Created By,Created On,Last Modified By,Last Modified
On;External:Created By,Created On,Last Modified By,Last Modified On
您不必为链接类型指定以下属性:
Created By
Created On
Last Modified By
Last Modified On
但前提是,您已经在对象 attributes 中指定这些属性,例如:
?attributes=Created By,Created On,Last Modified By,Last Modified
On &links=00000022;External
要返回任何类型的对象链接 (其中包含根据对象而定的 Created By、Created On、Last Modified By 和 Last Modified On,但不包含特定于链接的属性),还可以作如下简化:
links=*
limit
整型
如果已指定该选项,仅返回模块中的第一个 limit 对象。已删除的对象不计算在内,且 DOORS 表格仅计为 1 (表格行和单元格不计算在内)。limit 通常与 preview 结合使用,例如:
GET {DB}/module/00000020/objects?baseline=0.2&attributes=preview&limit=50
modifiedAfter
字符串
格式为 yyyy-MM-dd HH:mm:ss 的时间戳。如果已指定该选项,只应返回晚于此时间点而创建或修改的对象 (另请参阅上述 outline)。
对于 GET 请求,选项必须作为请求参数进行传递。
对于 POST 请求,选项必须作为请求正文中的 JSON 对象进行传递。
响应中包含模块 ID、名称、说明和前缀,以及 (DOORS Bridge 1.6 及更新版本) 模块是否实际已锁定,或者用户是否有权锁定和修改模块,外加:
信息
内容
baseline
关于请求基线的信息 (如有)
attributes
关于请求的属性及其类型的信息。无需请求默认/隐式属性,此处也不会列出这些属性。
linkTypes
关于请求链接类型及其请求属性 (以及属性类型) 的信息。
users
返回的对象中引用的所有 (不同) 用户的数组。只有在明确请求用户时,才会显示此信息 (请参阅上文)。
objects
指定的模块和基线 (如有) 中所有对象的数组 (依次排列)。
对象的类型如下:
类型
含义
1
需求
2
标题/文件夹
3
DOORS 表格
4
DOORS 表格行
5
DOORS 表格单元格
如果指定了 modifiedAfter,仅会包含晚于此时间点创建或修改的对象,但如果同时指定了 outline 或 baseline,会列出模块中的所有对象;而对于 objects,如果其 Last Modified On 时间戳早于 modifiedAfter,仅会显示有限的 outline 信息。
例如:
GET {DB}/module/00000020/objects?baseline=0.1&attributes=Created On,Created By,Last Modified On,Last Modified By,Status,users,attachments,discussions,history&links= 00000022;External
{
"id" : "00000020",
"name" : "Pflichtenheft",
"description" : "Ein Test Pflichenheft",
"prefix" : "PFL-",
"Created On" : 1487199600,
"Created By" : "Klaus",
"lock" : true,
"modify" : true,
"baseline" : {
"id" : "0.1",
"description" : "Initialer Stand",
"Created On" : 1489143451,
"Created By" : "Klaus"
},
"attributes" : {
"Created By" : 5,
"Created On" : 3,
"Last Modified By" : 5,
"Last Modified On" : 3,
"Status" : 6
},
"linkTypes" : {
"00000022" : {
"Created By" : 5,
"Created On" : 3,
"Last Modified By" : 5,
"Last Modified On" : 3
},
"External" : {
"Created By" : 5,
"Created On" : 3,
"Last Modified By" : 5,
"Last Modified On" : 3
}
},
"users" : [ {
"id" : "0000000000000002",
"name" : "Klaus",
"fullName" : "Klaus Mehling",
"email" : "[email protected]"
} ],
"objects" : [ {
...
}, {
"id" : 16,
"type" : 1,
"pid" : 12,
"text" : "Das ist ein __Beispiel__-Pflichtenheft zum Test des erweiterten Excel-Exports\\\\
\\\\
",
"Created By" : "Klaus",
"Created On" : 1487199600,
"Last Modified By" : "Klaus",
"Last Modified On" : 1487331196,
"discussions" : [ {
"name" : "Improvements",
"status" : "Open",
"Created On" : 1488296724,
"Created By" : "Klaus",
"Last Modified On" : 1488297333,
"Last Modified By" : "Klaus",
"comments" : [ {
"date" : 1488296724,
"author" : "Klaus",
"text" : "Yes, but via Wiki markup, not RTF !"
}, {
"date" : 1488297333,
"author" : "Klaus",
"text" : "Do we support Rich Text ?"
} ]
} ],
"history" : [ {
"date" : 1487244491,
"author" : "Klaus",
"action" : "createObject"
}, {
"date" : 1487331196,
"author" : "Klaus",
"action" : "modifyObject",
"attribute" : "text",
"old" : "Das ist ein __Beispiel__-Pflichtenheft ...\\\\
\\\\
",
"new" : "Das ist ein __Beispiel__-Pflichtenheft zum Test des erweiterten Excel-Exports\\\\
\\\\
"
} ]
}, {
"id" : 18,
"type" : 1,
"pid" : 17,
"text" : "[1-1.doc|!1-1.png!]\\\\
@Copyright __Intland Software Gmbh__ 2017, ''All rights reseved''\\\\
",
"Created By" : "Klaus",
"Created On" : 1487199600,
"Last Modified By" : "Klaus",
"Last Modified On" : 1488899013,
"history" : [ {
"date" : 1487244775,
"author" : "Klaus",
"action" : "createObject"
}, {
"date" : 1488899013,
"author" : "Klaus",
"action" : "modifyObject",
"attribute" : "text",
"old" : "\\\\
\\\\
@Copyright __Intland Software Gmbh__ 2017, ''All rights reseved''\\\\
",
"new" : "\\\\
@Copyright __Intland Software Gmbh__ 2017, ''All rights reseved''\\\\
"
} ],
"attachments" : {
"1-1.doc" : "DP7/O18-T1-1.doc",
"1-1.png" : "DP7/O18-T1-1.png"
}
}, {
...
} ]
}
已知问题
属性名称中包含前导或尾随空格
在 DOORS Bridge 构建版本 63 或更新版本中
可以正确处理其中包含前导或尾随空格的属性名称,但将属性指定为逗号分隔列表时,不能在逗号周围添加额外的空格。
在 DOORS Bridge 构建版本 62 或更新版本中
任何时候都不会返回名称中包含前导或尾随空格的属性,否则属性名称会被截断。
要解决此问题,必须移除 DOORS 属性名称中的前导和/或尾随空格。
获取有关导入指定基线集的必要步骤的信息
POST /doors/baselineSets
请求正文必须是 JSON 对象,其中包含以下信息:
server:至少具有 DOORS Bridge ID 的 JSON 对象。
username
password
baselineSets:要导入的基线集的数组 (应为从先前请求中返回的可导入基线集的子集)。
结果是一个由可导入的基线集构成的数组,其中每个基线集都包含一个由目标跟踪器关联模块构成的数组,而每个数组中都必须导入 baselines。
* 
与目标跟踪器不关联的模块,或者已导入到基线集中的基线或版本以外的模块,将被忽略。
例如,在请求由上一个示例返回的 baselineSets 的导入步骤时,如果每个基线集都包含两个模块,但其中只有一个模块 (id="00000580") 与跟踪器关联,而另一个模块 (id="00000581") 与跟踪器不关联,仅导入 id="00000580" 的模块。

[ {
"id" : "1.0.A-Sample",
"description" : "",
"Created On" : 1511964220,
"Created By" : "Administrator",
"definition" : {
"name" : "BLSD_0",
"description" : "script generated set definition for 'A-Sample'"
},
"date" : 1511964291910,
"modules" : [ {
"id" : "00000580",
"name" : "RS",
"description" : null,
"path" : "/Mechatronics/Raw_Project_2/RS",
"Last Modified On" : 1517471990,
"Last Modified By" : "Administrator",
"baselines" : [ {
"id" : "1.0.A-Sample",
"description" : "",
"Created On" : 1511964291910,
"Created By" : "Administrator",
"createdAt" : "Nov 29 2017 15:04"
} ],
"lastModifiedAt" : "Feb 01 08:59",
"tracker" : {
"id" : 139791,
"type" : 5,
"name" : "Lastenheft",
"project" : {
"id" : 34,
"name" : "Test"
}
}
} ]
}, {
"id" : "1.0.B-Sample",
"description" : "",
"Created On" : 1511964234,
"Created By" : "Administrator",
"definition" : {
"name" : "BLSD_1",
"description" : "script generated set definition for 'B-Sample'"
},
"date" : 1511965064910,
"modules" : [ {
"id" : "00000580",
"name" : "RS",
"description" : null,
"path" : "/Mechatronics/Raw_Project_2/RS",
"Last Modified On" : 1517471990,
"Last Modified By" : "Administrator",
"baselines" : [ {
"id" : "2.0.B-Sample",
"description" : "",
"Created On" : 1511965064910,
"Created By" : "Administrator",
"createdAt" : "Nov 29 2017 15:17"
} ],
"lastModifiedAt" : "Feb 01 08:59",
"tracker" : {
"id" : 139791,
"type" : 5,
"name" : "Lastenheft",
"project" : {
"id" : 34,
"name" : "Test"
}
},
"newerThan" : 1511964291910
} ]
}, {
"id" : "1.0.C-Sample",
"description" : "Administrator created set @ 29.11.2017 15:04:03:\nC sample comment\n",
"Created On" : 1511964243,
"Created By" : "Administrator",
"definition" : {
"name" : "BLSD_2",
"description" : "script generated set definition for 'C-Sample'"
},
"date" : 1517317172910,
"modules" : [ {
"id" : "00000580",
"name" : "RS",
"description" : null,
"path" : "/Mechatronics/Raw_Project_2/RS",
"Last Modified On" : 1517471990,
"Last Modified By" : "Administrator",
"baselines" : [ {
"id" : "3.0.C-Sample",
"description" : "Administrator created set @ 29.11.2017 15:04:03:\nC sample comment\n",
"Created On" : 1517317172910,
"Created By" : "Administrator",
"createdAt" : "Jan 30 13:59"
} ],
"lastModifiedAt" : "Feb 01 08:59",
"tracker" : {
"id" : 139791,
"type" : 5,
"name" : "Lastenheft",
"project" : {
"id" : 34,
"name" : "Test"
}
},
"newerThan" : 1511965064910
} ]
} ]
获取有关导入指定 DOORS 项目或文件夹中定义的所有可导入基线集的必要步骤的信息
GET /doors/bridge/{bridgeId}/folder/{projectOrFolder}/baselineSets/steps[?options]
选项
类型
必需
含义
bridgeId
整型
projectOrFolder 所属 DOORS Bridge 实例的 ID。正在调用的用户必须具有对指定 /doors/bridge/{bridgeId} 的访问权限,或者网桥必须是公开的。
server
字符串
DOORS Bridge 服务器的 (主机名、IP 地址和端口),例如 "http://my-doors-bridge:9090/db"。
username
字符串
用于登录底层 DOORS 实例的 DOORS 用户名。此 DOORS 用户必须具有 (在批处理模式下) 编辑 DXL 的权限。
password
字符串
用于对指定 DOORS 用户进行身份验证的 DOORS 密码。
projectOrFolder
字符串
要导入其已定义基线集的 DOORS 项目或文件夹的 ID。
获取有关将指定 DOORS 项目或文件夹中定义的所有可导入基线集导入到这些基线集中所包含模块的当前关联目标跟踪器的必要步骤的信息。
如需先验证模块跟踪器映射/配置或选择要导入的单个基线集,应先执行:
GET /doors/bridge/{bridgeId}/folder/{projectOrFolder}/baselineSets/project/{projIdOrName}[?options]
然后检查模块映射,接下来执行
POST /doors/baselineSets
导入一个或多个基线集
POST /project/{projIdOrName}/doors/baselineSets
选项
类型
必需
含义
projIdOrName
字符串
Codebeamer 项目的 ID 或名称,将从中导入基线集。
您必须为指定项目中的跟踪器管理员。
请求正文必须包含单个基线集 (JSON 对象) 或基线集的数组,如下面方法中所返回:
GET /doors/bridge/{bridgeId}/folder{projectOrFolder}/baselineSets/steps[?options]
POST /doors/baselineSets
这对您有帮助吗?