Jump to content

Gantt task links via API


Houssam

Recommended Posts

In the Gantt tool, we can create task links and assign them some attributes (start-to-finish, lag). I wish to manage these links myself through the API - is it currently possible? Using the network tab in the browser, I can see these changes being recorded as an entity of type 'dependency', but it isn't listed in the API schema reference and my attempts to target it through the python API client fail.

Any ideas of what I can do here?

Link to comment
Share on other sites

Hi @Houssam

Apologies for the delayed response here, but thanks for the great question! You can edit set these links through the ftrack API.

There are two types of entities that can be linked:

* Versions can be linked to other asset versions, where the link entity type is AssetVersionLink.
* Objects like Task, Shot or Folder, where the link entity type is TypedContextLink.

Both AssetVersion and TypedContext objects have the same relations incoming_links and outgoing_links. To list the incoming links to a Shot we can use the relationship incoming_links:

for link in shot['incoming_links']:
    print(link['from'], link['to'])

In the above example link[‘to’] is the shot and link[‘from’] could be an asset build or something else that is linked to the shot. There is an equivalent outgoing_links that can be used to access outgoing links on an object.

To create a new link between objects or asset versions create a new TypedContextLink or AssetVersionLink entity with the from and to properties set. In this example we will link two asset versions:

session.create('AssetVersionLink', {
    'from': from_asset_version,
    'to': to_asset_version
})
session.commit()

So in your case, for tasks you would use the TypedContextLink. We have some more examples on this here

Hope this helps clarify, if you have any further questions don't hesitate to give us a shout. 

Cheers,
Andrew

 

Link to comment
Share on other sites

Thanks, I understand now how to get the link data from the API. I am also interested in the Type and Lag values that are available to us on the site - do we have access to these from the API?

image.png.2771fa354ee43e52b21096483361e561.png

They don't seem to be part of the TypedContextLink. I have checked the metadata dictionary that is attached to it but it's empty.

Thanks

 

Link to comment
Share on other sites

Hi @Houssam

Thanks for bearing with me there, I can confirm that the Dependency Type and Lag are not currently accessible via the ftrack API. We'll be sure to scope out a feature request for this addition, though we'd love to learn a bit more about your specific use-case to ensure we're scoping something out that would suit your need.

If theres any background you can share on the types of workflow you envision for this we'll be happy to get something written up for consideration.

Cheers,
Andrew

Link to comment
Share on other sites

  • 2 weeks later...

Hi Andrew

We have a customer who uses ftrack to manage their projects but wishes to use an external system to help with automatically scheduling tasks. Having these extra details will help us have a more accurate timeline to assist with this type of scheduling.

Thanks

Link to comment
Share on other sites

Hi Houssam, 

Thanks so much for the additional context here, I've gone ahead and scoped out a request for this with out product team for consideration. While I can't confirm any ETA, don't hesitate to reach out here should this get more urgent for you and your team. 

Cheers,
Andrew

Link to comment
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
×
×
  • Create New...