JSON API Guide → Reference → GET Functions → GetItemsByItemID
Gets multiple items matching the specified prefix and ID.
Name | Type | Description |
---|---|---|
GetItemsByItemId | Function |
Gets multiple items matching the prefix and ID that are passed. Item IDs are not unique, so this query returns an array of results. Unlike the report-based calls, you cannot request a second page of results with this query. Results are sorted by the Item ID field. |
table |
|
The primary or auxiliary table identifier. Note that name is case sensitive and can be changed in SBM Composer and deployed. |
itemId |
|
The item ID. For example: BUG2, ENH000079, *, %, BUG, BUG*, BUG*2, BUG*2*. |
In the direct access URL, you can specify the item ID as BUG2 or BUG000002:
http://AEserverName/jsonapi/getitemsbyitemid/Issues/BUG2?pagesize=2
Note that you cannot use * or % in the path part of the URL. However, in the longer URL format, you can specify either wildcard.
For example:
JSONPage&command=jsonapi&JSON_Func=getitemsbyitemid&JSON_P1=1000&JSON_P2=BUG*2
Name | Type | Description |
---|---|---|
itemOptions
(optional) |
ItemOptions |
Use itemOptions to limit the response data. When itemOptions are included, only the specified fields are sent in the response. |
pagesize
(optional) |
integer |
Add &pagesize=100 to the URL to override the user's page size preference. For example, &pagesize=1 ensures that only the first item found is returned. |
URL:
http://AEserverName/jsonapi/GetItemsByItemID/Issues/BUG?pagesize=2
Post data:
{fixedFields: false, fields: [{dbname:"TITLE"}, {dbname: "FUNCTIONAL_AREA"}]}
Response:
{ "searchResults": { "totalItems": 69, "pageSize": 2 }, "table": { "id": 1000, "uuid": "dc8cd329-b430-436f-bb75-bf90008e6a50", "name": "Issues", "dbName": "UBG_ISSUES" }, "fieldMetadata": [ { "id": 54, "name": "Title", "dbname": "TITLE", "syscode": 4, "type": "text", "renderHtml": false, "password": false, "maxLength": 80 }, { "id": 75, "name": "Functional Area", "dbname": "FUNCTIONAL_AREA", "syscode": 0, "type": "selection", "renderHtml": false, "isMultiSelect": false } ], "items": [ { "id": { "id": 2, "uuid": "46ad4b77-4c8e-445d-b6d8-e84b71cfb8ab", "itemIdPrefixed": "BUG000002", "itemId": "000002", "url": "http://AEserverName:80/tmtrack/tmtrack.dll?...Template=view&TableId=1000" }, "fields": { "TITLE": { "value": "Upgrade from 4.0 does not work correctly" }, "FUNCTIONAL_AREA": { "id": 0, "name": "(None)" } } }, { "id": { "id": 13, "uuid": "9506eb9c-0822-4944-b023-5142696c64d1", "itemIdPrefixed": "BUG000028", "itemId": "000028", "url": "http://AEserverName:80/tmtrack/tmtrack.dll?...Template=view&TableId=1000" }, "fields": { "TITLE": { "value": "404 page not found error" }, "FUNCTIONAL_AREA": { "id": 0, "name": "(None)" } } } ], "result": { "type": "OK", "msg": "" } }
Because the TS_ID is subject to change in a promotion context, you may need to update the table parameter with the TS_ID from the target environment after the promote is finished.
Copyright © 2007–2016 Serena Software, Inc. All rights reserved.