ProjectService1 > AddTask > unitOfWorkId

  • 1
  • Question
  • Updated 4 months ago
  • Answered
The service at https://sp1.replicon.com/services/ProjectService1.svc/help/test/AddTask specifies a required field called 'unitOfWorkId'

I can find absolutely no reference to uintOfWorkId in any documentation - and I can't see it in any of the request responses in the running Replicon site.

Can anyone tell me a valid value to supply for this required field?
Photo of Drury-Green, Grant

Drury-Green, Grant

  • 10 Posts
  • 0 Reply Likes

Posted 4 months ago

  • 1
Photo of Akbar Ali Khan

Akbar Ali Khan, Official Rep

  • 162 Posts
  • 5 Reply Likes
Hi Grant,

The field unitOfWorkId under ProjectService1>AddTask has to be a unique alpha numeric id, you can choose the alpha numeric id of your choice however it has to be a different id every time you use the service. 

Thanks,
Akbar
Photo of Drury-Green, Grant

Drury-Green, Grant

  • 10 Posts
  • 0 Reply Likes
OK... so I'm supplying the following payload to the AddTask service (which meets the documented minimum required fields):

(NOTE: **mytenantid** is supplied as a valid UUID, just redacted here...)
{
  "project": {
    "uri": "urn:replicon-tenant:**mytenantid**:project:4",
    "name": null,
    "parameterCorrelationId": null
  },
  "task": {
    "target": null,
    "name": "A task from API",
    "code": null,
    "description": null,
    "timeEntryDateRange": null,
    "percentCompleted": "0",
    "isTimeEntryAllowed": "true",
    "estimatedHours": null,
    "isClosed": "false",
    "customFieldValues": [],
    "estimatedCost": null,
    "costTypeUri": null,
    "timeAndExpenseEntryTypeUri": null,
    "assignedResources": []
  },
  "unitOfWorkId": "1557100621547"
}

I am receiving the following error:
{
  "error": {
    "code": "InternalServiceFault",
    "correlationId": "597ad5712c1c4f2b8c23ad19963b8800",
    "reason": "The server was unable to process the request due to an internal error."
  } 
}

Are you able to explain what may be going wrong?

Photo of Akbar Ali Khan

Akbar Ali Khan, Official Rep

  • 162 Posts
  • 5 Reply Likes
Hi Grant,

The error is showing up as there is no value provided in the 'Target' field.

Please go through the instruction mentioned below, do let me know if you are able to add the task using ProjectService1.svc/AddTask by following the instructions mentioned below.

 1. Select the project 
 2. Expand target and in the name field enter the name < Task name> (Optional field, but needs to be entered)
 3. Expand the parameter and enter the same name as mentioned in the target name <Task name> (Optional filed but needs to be entered)
 4. Enter the required fields percentage completed as '0' 
 5. istimeentryallowed as 'true'
 6. isClosed as 'False'

(Edited)
Photo of Drury-Green, Grant

Drury-Green, Grant

  • 10 Posts
  • 0 Reply Likes
Hmmm... maybe 'target' should be noted as a required field if it is required...