Using CSOM I can see how to use the SetCustomFieldValue method to update custom fields associated to a Project, but is it not possible to do this for a task within Project Online? I don't see anything that would allow this but it does list in the documentation this should be possible.
Thanks!
I can give you a JSOM example to do this:
That should be complete (though I pulled it from a script, so check the success / failure handlers which I truncated)
From memory poking around in the CSOM there is no "set_item(cf, val)" helper method to use, but it was similar, I think the property is set on the object instance via an indexer, e.g.:
(sudo c# code)
etc.
If that doesn't help then you can always reflect the ProjectServer.Client.DLL and you'll see the internal implementation of "SetCustomFieldValue" which is not publicly exposed.
Hope that helps someone.
Have you looked at this thread? Use CSOM to update project's custom fields
It's Project level but it may provide some further clues. Actually, there's task level code at the bottom of that post so hopefully, that's what you need.
I've also searched for a way of updating task level custom fields, but couldn't find a solution. For this and some other reasons I've decided to do this by implementing a projectdrilldown extension. This means to update the value directly in the project grid and let project server do the rest of the internal processing: