Skip to main content
Dec 12, 2023 9:56 AM UTC
Solved

OData - CompleteWorkitem returns the error "This task cannot be updated..."

Dear all,

 

I have a question regarding completing the work items. I have a work item which includes a custom EnumeratedType attribute "MySize". 

 

xolomon_0-1702374258679.png

When I try to complete the activity using the OOTB Endpoint from Workflow Domain, I am getting an error that the enumerated type is not supported like below:

 

"This task cannot be updated.Variable type ext.dropdown.MySize is  not supported."

 

xolomon_1-1702374687893.png

URL: {{baseUrl}}/WorkItems('{{WorkItemId}}')/PTC.Workflow.CompleteWorkitem

Request Body: 

{
    "AutomateFastTrack": false,
    "UserEventList": ["Yes"],
    "VoteAction": "",
    "WorkitemComment": "Dummy",
     "Variables":[{
        "Name":"MySize",
        "Value":"Small",
        "TypeName":"ext.dropdown.MySize",
        "DisplayName":"MySize"
    }]
}
Does anybody have a solution / workaround regarding this? 

 

Thanks in advance!

Dec 18, 2023 9:07 AM UTC

Hi @xolomon 

I can see just only one workaround.

extends existing site, with own custom REST API function that does exactly what you need.

PetrH

13 replies

Dec 12, 2023 1:31 PM UTC

Hi @xolomon 

Be careful if you use display value or the internal value of the enumeration. 

I guess that you should use the internal value.

And the question of the day, Is the internal value real;y "Small" ? 

PetrH 

xolomonAuthor
Dec 12, 2023 1:36 PM UTC

Hi @HelesicPetr,

 

thanks for the remark, I have been trying with both internal and external values. But unfortunately this is not the main problem.  It seems that OOTB only allows primitive, string and date variables in this area. 

 

Cheeers,

Xolomon

Dec 12, 2023 1:38 PM UTC

@xolomon 

Then it seams that the RestApi method do not support the custom enumerations,

PetrH