Updated Custom Fields

I realise I’m very late to this party, but I have been working with non-global custom fields this week and have run into some problems. The documentation is still not up to date regarding how these work with the API.

I have noticed that certain fields are not applied to newly created project-local fields, notably format (they seem to work fine for global fields):

EDIT: This does not apply to project local fields only, creating new number custom fields as global fields also fails to store or update the format attribute and related fields.

            "precision": 1,
            "format": "percentage",
            "resource_subtype": "number"
        }
    }
}

RESULT
{
    "data": {
        "gid": "1202858477963949",
        ...
        "custom_field": {
            "gid": "1202858477963950",
            "resource_type": "custom_field",
            "created_by": ...
            "resource_subtype": "number",
            "type": "number",
            "name": "Local Number test",
            "precision": 1
        },
        ...
    }
}

---

GET /custom_fields/1202858477963950?opt_fields=format,resource_subtype,precision

RESULT
{
    "data": {
        "gid": "1202858477963950",
        "precision": 1,
        "format": "none",
        "resource_subtype": "number"
    }
}

This also applies to currency_code, custom_label and custom_label_position (since the format defaults to none)

Additionally, the format field cannot be updated via PUT request to the custom field endpoint, either for local or global fields.

Since there is no official documentation other than this thread which describes the intended behaviour, I can’t really say this is a bug, but it does seem like something is missing from the custom fields API implementation.


Edited to add that this is not specific to project-local custom fields, but also applies to creation of new global custom fields.

1 Like