Tasks, Task Dependencies, and the Gantt are great tools for visualizing and organizing a schedule within Shotgun. Sometimes it’s useful to set up offsets between dependencies, as maybe the dependent Task doesn’t need to start exactly the day after the upstream Task is finished. Just clicking and dragging a dependent Task in the Gantt will cause it to become pinned. Using our Alt key, we can move Tasks further down the timeline and still have dependencies automatically adjust all other tasks in the chain, without pinning the Task in place on the Gantt.
The offset field is actually on the TaskDependency entity (instead of Task) which isn’t visible in Shotgun since it’s buried a little deeper. However, it is possible to populate an offset via the API. I’ll pass along your feedback to our product team, thanks for sharing
Using our Alt key, we can move Tasks further down the timeline and still have dependencies automatically adjust all other tasks in the chain, without pinning the Task in place on the Gantt.
We use this but It is buggy, sometimes it takes you several attempts in order to get it right, because when you release the mouse button, sometimes the Task doesn’t stay where you left it and shifts to another date, really frustrating.
However, it is possible to populate an offset via the API.
Cool, where can we find the Docs for doing the previous?
Hey @doc !
Sorry you’re getting some buggy behavior. I haven’t seen any bugs related to this yet. When you experience this, is your browser at 100% zoom? We’ve often seen reports on issues with gantt functionality when the browser isn’t at 100%, so that would be the first thing to check. Then, if you need to adjust the zoom, just do that with the provided scaler on the gantt (upper right) . You’ll also want to make sure you are using a recommended browser. Can you see if that may have caused that issue?
Here’s a quick Python API snippet that show how you can change offset values in task dependencies. How you get the tasks is obviously up to you but you should get the gist. There’s an extra schema call in there just for demo purposes.
This will create an offset of two days between your tasks. This offset will render in the gantt and when you move the first task, the second one will follow with the specified offset.
You can also specify a negative offset in order for the second task to start before the first is finished.
Thanks @shaynad,
Yes, I’ve also noticed that SG doesn’t behave well when the browser is not at 100% zoom, but even taking care of that, sometimes offsetting the Tasks does not behave as expected.
We’ll take a look at the recommended browsers matrix, perhaps the version of Google Chrome we’re using on CentOS 7 is not helping.
The REST API and the Python API are functionally equivalent so everything described here should be possible.
The REST API has a schema endpoint which allows you to see which entities are accessible via REST. TaskDependency is definitely one of those accessible entities.
To read a TaskDependency you could do:
r = requests.get(SITE_URL + '/api/v1/entity/task_dependencies/70', headers=auth_header)
Thanks @bouchep. I did find the TaskDependency in the Schema and I’m able to read and write to it. The strange thing is that I cannot seem to get Task Dependency object info when getting a Task data, even when I specifically ask for all fields (?fields=*) or explicity ask for Task Dependency field info (task_dependency.TaksDependency.id for example. Does this relationship to the Tasks entity work in a different way than usual? Thanks!
Was there ever any further discussion on having the TaskDependency entity exposed in the webUI, specifically to have better control over the offsets. Now that generative scheduling is a thing, it would be extremely helpful for setting up better templates quickly. Especially if it has options for setting fixed day vs relative offsets like you can via OSF JSON files.
I was thinking that if I could setup a connection entity list page that it might work but it doesn’t appear to be an option presently.