REST API - previewWorkItemFromList

The table summarizes the REST API - previewWorkItemFromList.

Request

Format
GET <baseurl>/worklist/previewitems/<entitytype>/<entityguid>
Path parameters
  • entitytype: one of these enumerated values, defining the type of the organization model entity.
  • entityguid: Globally unique ID of the organization model entity.
Query parameters
  • id=long (required). The IDs of one or more work items to be previewed. All work items must be from the work list of the same organizational entity.
  • version=long (required). The version number of the work item ID specified above.
  • field=string (optional). This is the field name you require data back for.
  • requireworktype=boolean (optional). If true, the response includes Work Type information.

Note: The id, version and field parameters can be multiples. Id and version must be pairs. Field name values can be as many or as few as you want. For example:

id=1&id=2&id=3&version=1&version=2&version=3&field=orgName 

Response

JSON Returns a JSON representation of the content of the previewWorkItemFromListResponse element.
XML Returns the content of the previewWorkItemFromListResponse element (from the WorkListService schema).

Example

Request
GET <baseurl>/worklist/previewitems/RESOURCE/3855E1D1-D395-43C7-89ED-FFF4C5B8AE1B?id=1&id=2&version=0&version=0&requireworktype=true
Response
{
  "workItemPreview": {
    "@id": "18",
    "@version": "0",
    "FieldPreview": [
      {
        "@name": "address",
        "@type": "String",
        "@array": "true",
        "simpleSpec": {
          "value": [
            "Krypton",
            "Dc MultiVerse"
          ]
        }
      },
      {
        "@name": "name",
        "@type": "String",
        "@array": "false",
        "simpleSpec": {
          "value": "SuperMan"
        }
      },
      {
        "@name": "dob",
        "@type": "Date",
        "@array": "false",
        "simpleSpec": {
          "value": "1945-03-23"
        }
      }
    ],
    "workType": {
      "@workTypeID": "WT__xeWr0DBIEeWqbojG9dIHjQ",
      "@version": "1.0.0",
      "@workTypeDescription": "ocf_UserTask_admin"
    }
  }
}