Update Task Custom field

  • 1
  • Question
  • Updated 3 weeks ago
  • Answered
I'm trying to work out how to update Custom (User Defined) field values for a Task using the API.

Nothing is jumping out to me when i look through the service test pages.

Is this possible currently?
Photo of Drury-Green, Grant

Drury-Green, Grant

  • 10 Posts
  • 0 Reply Likes

Posted 4 weeks ago

  • 1
Photo of Akbar Ali Khan

Akbar Ali Khan, Official Rep

  • 134 Posts
  • 3 Reply Likes
Hi Grant,

You could update the custom field on a task using 'PutTask' under ProjectService1, do let me know if you have any difficulties updating a custom field in a task using the web services.

Thanks,
Akbar.
Photo of Drury-Green, Grant

Drury-Green, Grant

  • 10 Posts
  • 0 Reply Likes
So, using the page at: https://sb1.replicon.com/services/ProjectService1.svc/help/test/PutTask

I've made numerous attempts, but can't find the correct combination of URIs / values / magic / ... to not result in a 'Bad request'

The latest result was:

{
  "error": {
    "code": "InternalServiceFault",
    "correlationId": "22616ab89a3c446682e0b50aa8bb917d",
    "reason": "The server was unable to process the request due to an internal error."
  } 
}

In this request i supplied:
  • Project URI
  • Task URI
  • Custom Field[0] uri
  • dropdownOption URI (it's a drop down)

   
(Edited)
Photo of Akbar Ali Khan

Akbar Ali Khan, Official Rep

  • 134 Posts
  • 3 Reply Likes
Hi Grant,

I have found a better way of updating the task level custom fields for you.

Please do go through the instructions mentioned below in-order to update the task level custom fields on tasks.

1. Please login to Replicon as an administrator and go into Web services.

2. Locate CustomFieldService1 on the web services page and click on it.

3. Locate GetCustomFieldGroups under CustomFieldService1 and click on it.

4. Click on 'Submit' and copy the 'Task' Custom field group URI,

5. Go back into CustomFieldService1, locate and click on  'GetAllCustomFields',

6. Please enter the 'Task' Custom field group URI into the objectUri field that was copied earlier from 'GetCustomFieldGroups', click submit and copy the URI for the task level custom field. (Using this service you will be able to find out if the custom field created on the task level is a text, drop-down, number or date custom field apart from the custom field Uri)

7.  Go back into CustomFieldService1 and locate UpdateDropdownValue (for Drop-down type custom field), UpdateDateValue (for Date type custom field), UpdateNumericValue (for Number type custom field), UpdateTextValue (for text type custom field)

8.You will need to specify the Task uri in the objectUri once you have selected the Update service under CustomFieldService1, the custom field Uri in the customFieldUri section and the new custom field value in the 'value' field.

Please note that if you are using a drop-down type custom field then you will need specify the drop-down value Uris as well.

Please go into GetAllCustomFieldDropDownOptions under CustomFieldService1, provide the custom field Uri to retrieve the Uris of the drop-downs in a drop-down type custom field

Thanks,
Akbar.
(Edited)