API: Clarification on Custom Field Parameters

Hello,

I am developing an application using the Clockify API and would appreciate some clarification on the behavior of a few custom field parameters. I’ve been reviewing the documentation, but I am still unclear on the following points:

- sourceType in userCustomFieldValues:

  • The documentation (under Get member’s profile > Response Schema) lists this as “WORKSPACE” or “USER”.

  • Could you explain the functional difference between these two source types?

  • How can I create or update a user’s custom field to produce a sourceType of “WORKSPACE” versus “USER”?

- workspaceDefaultValue Behavior:

  • I’ve attempted to set a workspaceDefaultValue for a custom field. However, in my tests, when I add this custom field to a user and don’t specify a value, the user’s value for that field is null, not the default I set.
  • Is this the expected behavior? If so, what is the intended use case for workspaceDefaultValue?

- projectDefaultValues:

  • Similar to the above, how is the projectDefaultValues parameter intended to function?
  • Which API endpoint and request body should I use to create a custom field where I can successfully populate the projectDefaultValues?

Thanks.

Hello,

The default value should take place when, for example, a Project is created; this value will automatically be applied; however, it will not be changed on already existing projects.

The same goes for user custom fields; if a field with a default value is in the active column, all newly invited users will have the default value. The custom fields are not assigned to users, and will appear on users as soon as you move them to the “Active” column in the workspace.

Can you please paste the endpoints that you were using so I can try and reproduce it on our end?

You can paste the links from this documentation if it is easier for you: https://docs.clockify.me/. This way, I can see the order of events and potentially recreate it on my end and check what the intended behavior should be.