Why after updating a queue item with odata/QueueItems(Id) SpecificContent is lost?

Why after updating a queue item with odata/QueueItems(Id) we lose SpecificContent?

Issue:

Queue item had a SpecificContent value.

The queue item was updated with PUT for odata/QueueItems(141515827)

Body:

{

"Name": "BF - Payroll Reporting - Jobs",

"Priority": "High"

}

In the end, the SpecificContent becomes null. Why?

Resolution:

The encountered behavior is expected when the queue item is updated without specifying its SpecificContent in the case it exists.

In our backend Rest API call for PUT operation, we are also specifying the SpecificContent payload (if it doesn't exist, we are setting it to null, if exists, we will provide its value again)

This is a regular example from backed when SpecificContent doesn't exists:

{"Name":"BF - Payroll Reporting - Jobs","Priority":"Normal","SpecificContent":null,"DeferDate":null,"DueDate":null,"Reference":"13529","Progress":null}

This is a regular example from backed when SpecificContent exists:

{"Name":"BF - Payroll Reporting - Jobs","Priority":"Normal","SpecificContent":{"Frequency":"Monthly","HsbcReportNumber":"110029","McpFileName":"CO900268","PayDate":"2021-12-24","ReportInfo":"[{\"ReportName\":\"PACMPT2\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PACMPT2 (F#2372)\"},{\"ReportName\":\"PAHSBCNT\",\"ExportFileType\":\"TXT\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAHSBCNT (F#2373)\"},{\"ReportName\":\"PAMETHSP\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAMETHSP (F#2374)\"},{\"ReportName\":\"PAP32TSL\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAP32TSL (F#2375)\"},{\"ReportName\":\"PAPEN1\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAPEN1 (F#2376)\"},{\"ReportName\":\"PAPRADRN\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAPRADRN (F#2377)\"},{\"ReportName\":\"PARUN6\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PARUN6 (F#2378)\"},{\"ReportName\":\"PARUNT3\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PARUNT3 (F#2379)\"}]","RpaJobReference":347,"Version":"V01"},"DeferDate":null,"DueDate":null,"Reference":"13529","Progress":null}

So you are missing one extra step before making the update. Verify if your queue item is having some specific content in order to not delete it.

In advance run a GET command for your queue item Id or Reference (in the case if it is unique):

Example:

https://cloud.uipath.com/{ACCOUNT_NAME}/{TENANT_NAME}/odata/QueueItems?$filter=Id eq 139126355&$select=Reference,Status,SpecificContent&$count=true

The response will be something similar to

{

"@odata.context": "https://cloud.uipath.com/{ACCOUNT_NAME}/{TENANT_NAME}/orchestrator_/odata/$metadata#QueueItems(Reference,Status,SpecificContent)",

"@odata.count": 1,

"value": [

{

"Status": "New",

"Reference": "13529",

"SpecificContent": {

"Frequency": "Monthly",

"HsbcReportNumber": "110029",

"McpFileName": "CO900268",

"PayDate": "2021-12-24",

"ReportInfo": "[{\"ReportName\":\"PACMPT2\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PACMPT2 (F#2372)\"},{\"ReportName\":\"PAHSBCNT\",\"ExportFileType\":\"TXT\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAHSBCNT (F#2373)\"},{\"ReportName\":\"PAMETHSP\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAMETHSP (F#2374)\"},{\"ReportName\":\"PAP32TSL\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAP32TSL (F#2375)\"},{\"ReportName\":\"PAPEN1\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAPEN1 (F#2376)\"},{\"ReportName\":\"PAPRADRN\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAPRADRN (F#2377)\"},{\"ReportName\":\"PARUN6\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PARUN6 (F#2378)\"},{\"ReportName\":\"PARUNT3\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PARUNT3 (F#2379)\"}]",

"RpaJobReference": 347,

"Version": "V01"

}

}

]

}

Extract from the above result the SpecificContent if exists, and then perform your PUT operation.

Example:

PUT for https://cloud.uipath.com/https://cloud.uipath.com/{ACCOUNT_NAME}/{TENANT_NAME}/odata/QueueItems(141515827)

In Headers specify:

X-UIPATH-OrganizationUnitId: FOLDER_ID_VALUE (in int)

Content-Type: application/json

In Body (raw as JSON):

{

"Name": "BF - Payroll Reporting - Jobs",

"Priority": "High",

"SpecificContent":{"Frequency":"Monthly","HsbcReportNumber":"110029","McpFileName":"CO900268","PayDate":"2021-12-24","ReportInfo":"[{\"ReportName\":\"PACMPT2\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PACMPT2 (F#2372)\"},{\"ReportName\":\"PAHSBCNT\",\"ExportFileType\":\"TXT\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAHSBCNT (F#2373)\"},{\"ReportName\":\"PAMETHSP\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAMETHSP (F#2374)\"},{\"ReportName\":\"PAP32TSL\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAP32TSL (F#2375)\"},{\"ReportName\":\"PAPEN1\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAPEN1 (F#2376)\"},{\"ReportName\":\"PAPRADRN\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PAPRADRN (F#2377)\"},{\"ReportName\":\"PARUN6\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PARUN6 (F#2378)\"},{\"ReportName\":\"PARUNT3\",\"ExportFileType\":\"PDF\",\"Sort\":,\"Filter\":,\"FilingId\":\"PARUNT3 (F#2379)\"}]","RpaJobReference":347,"Version":"V01"}

}