GetItemsByInternalID

Gets multiple items matching one or more internal IDs (TS_IDs).

Parameters

Name Type Description
GetItemsByInternalId Function

Gets multiple items matching the internal IDs 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
  • ID (integer)
  • UUID (string)
  • dbname (string)
  • name (string)

The primary or auxiliary table identifier.

Note that name is case sensitive and can be changed in SBM Composer and deployed.

internalId
  • ID (string)

A comma-separated list of TS_IDs. For example: 1,2,3,4,5.

Note that this parameter is optional in POST calls if the requestedItems option (described below) is provided in the POST data. If you include the internalId parameter on a POST call, it takes precedence over the requestedItems data if it is also included. This means only the integers on the URL will be included in the result.

Usage

In the direct access URL, you can specify the items by TS_ID:

http://AEserverName/jsonapi/getitemsbyinternalid/Issues/1,2,3,4?pagesize=2

Longer URL format example:

JSONPage&command=jsonapi&JSON_Func=getitemsbyinternalid&JSON_P1=1000&JSON_P2=11,12,13

Post Data

You can optionally use the GetItemsByItnternalID function in an HTTP POST and include one or more of the following objects:

Name Type Description
requestedItems

(optional)

string

A comma-separated list of TS_IDs (integers).

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.

Example

URL:

http://AEserverName/jsonapi/GetItemsByInternalID/Issues/1,2,3?pagesize=1

Post data:

{fixedFields: false, fields: [{dbname:"TITLE"}, {dbname: "FUNCTIONAL_AREA"}]}

Response:

{
"searchResults": {
"totalItems": 2,
"pageSize": 1
},
"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?
IssuePage&RecordId=2&Template=view&TableId=1000"
},
"fields": {
"TITLE": {
"value": "Upgrade from 4.0 does not work correctly"
},
"FUNCTIONAL_AREA": {
"id": 0,
"name": "(None)"
}
}
}
],
"result": {
"type": "OK",
"msg": ""
}
}

Comments

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.