Paul Sorge Posted April 19, 2018 Report Share Posted April 19, 2018 Hi, I would like to update the value of a project's custom attribute via the javascript api. Is that even possible in v.0.4.5? Since the ContextCustomAttributeValue does not have an own id (at least none is provided when fetching the custom_attributes as a relation of a project), I cannot find a way to specify the (entity-) key argument in the session.update('ContextCustomAttributeValue', [key], data) function. Or can the key argument array hold multiple values to specify the exact ContextCustomAttributeValue (like entity_id of the project and the key of the custom_attribute)? I tried some things there to no avail. Or is that just the wrong approach? Thanks in advance, Paul Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted April 23, 2018 Report Share Posted April 23, 2018 Hi Paul and welcome to the forums. This is an example of how to se the ContextCustomAttributeValue, the first id in the entity_key is the custom attribute configuration id, the second one is the project id. {"action": "update", "entity_data": {"__entity_type__": "ContextCustomAttributeValue", "value": "31"}, "entity_key": ["d25219d6-acb5-11e1-8668-f23c91df1211", "32580850-64a2-11e7-a4bd-0a580ae40187"], "entity_type": "ContextCustomAttributeValue"} Link to comment Share on other sites More sharing options...
Paul Sorge Posted May 3, 2018 Author Report Share Posted May 3, 2018 Hi Mattias, thanks, it works. Just out of curiosity: Is that procedure documented anywhere? Because I tried to look it up before posting here and could not find anything. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted May 4, 2018 Report Share Posted May 4, 2018 Afaik this is not documented. The ftrack-python-api hides this in convenience method and the user never has to understand this part, but for the javascript API things are more hands-on. I will raise this question with the team. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.