HTTP: Update task's status
1 1

3 posts in this topic

Hi there,

I'm currently integrating ftrack into some existing processes on our side.

One step is that a client can use a web-interface from us where she/he may set some things approved/unapproved. I'd like to get a direct feedback of this one to an internally referenced task in ftrack.

So, there is a update call that looks like that:

{
  action: update
  entity_type: Task
  entity_key: [ #ID OF THE TASK# ]
  entity_data:
  {
    status: 
    {
      __entity_type__: Status
      id: #ID OF THE STATUS I LIKE TO SET#
    }
  }
}

I get the response "Cannot set relationship to string value." (value error).

Updating other things (like name, etc.) works (as I set the string directly), but it won't let me update the status.

So, what am I doing wrong here?

 

Thanks in advance!
Chris

Share this post


Link to post
Share on other sites

The Python API Client often uses relationships (e.g. status) to update entities, but when using the raw API backend or the JS API client I recommend that you instead the relationship key attributes instead. In this case, that would be `status_id`.

A more complete example of a request body would be:

[
  {
    "action": "update",
    "entity_type": "Task",
    "entity_key": [
      "12bd29be-72b0-11e7-96a7-0a580ae40a16"
    ],
    "entity_data": {
      "status_id": "44dd9fb2-4164-11df-9218-0019bb4983d8",
      "__entity_type__": "Task"
    }
  }
]

Regards,
Lucas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1