Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

Trying to set the duration of a task in fusion

Avatar

Level 3

I am trying to set the duration of a task in Fusion. I am assuming that "day" is the default duration and simply entering the number "2" in the Duration field (trying to enter any letter such as d for day shows an error,. but it is not working. Any help would be appreciated.

13 Replies

Avatar

Level 10

Hello Ronald,

 

If you check the API Explorer under TASK you will see, that there are different fields, that have something to do with the task duration.

 

- duration (double)

- durationExpression (string)

- durationMinutes (int)

- durationType (string / enum)

- durationUnit (string / enum)

 

Clicking on each of those entries in the API Explorer will show you some details.

 

I just tried to update a task duration using the module Update record. It simply worked passing an integer to the field duration.

 

Before I used the Read a record module passing * as output to get all fields. There I recognized, that the task I updated was set like this:

 

durationType: A
durationUnit: H

 

The field durationMinutes was calculated automatically.

 

I would suggest playing around a bit, perhaps the durationType can be showstopper when trying to simply update the duration field...

 

I hope I could help a bit.

 

Regards

Lars

Avatar

Level 1

hey @RonaldEa I'm not sure if I understood correctly....
I was trying to test a case updating the duration of a task and yep... the duration is calculated by days

OlenkaVarLazCo_0-1706714202210.png

 and it's working correctly for me
- reviewed the connection in both cases (to read and update a record)
- set the ID and Duration

OlenkaVarLazCo_1-1706714330527.png

- reviewed the updated field

OlenkaVarLazCo_2-1706714365099.png

 

Avatar

Level 3

m I may be bugged somehow then because that is the exact field I am updating and yes I am just tying in a number like that but it's NOT updating the duration.

 

I will see about opening a ticket with Workfront. Thanks.

Avatar

Level 10

Can you post the output of the fields I listed in my upper post?

 

Regards

Lars

Avatar

Level 3

Hi Lars, here is the output from the module where we are creating the task. With that said, it's only durationType S (Simple) because I am setting that in the module that creates the task. As per my previous post, if i DON'T set that manually, it defaults to creating the task with duration type Calculated Work.

 

  • durationType S
  • durationUnit D

Avatar

Community Advisor

Check the task schedule type. Certain schedule types cannot have the duration set.

Avatar

Level 3

If you mean the Duration type, yes that does seem to be somehow impacting things. There is something with the simple duration type that fusion doesn't like. What we are doing is having fusion create a task and then trying to set the duration of that task to 2 days. If we don't manually set the duration type to simple, fusion defaults to setting that to Calculated Work. If the duration type is set to Calculated Work, we are able to set the duration. But if at any point we change the duration type to Simple, it either clears out the duration if we had already set it, or blocks the ability to set the duration in the same module or any successive module. However, the Simple Duration Type is absolutely able to have the duration set (proven by simple being the default duration type on all our tasks in the system and we can set the duration anywhere and have been for the last 6 years). So I am not sure what additional interaction(s) may be taking place.

Avatar

Community Advisor

I was referring the task constraint (edit), i.e. must start on, must finish on, fixed dates, etc.

 

I just did a quick test for duration type Simple, and just providing an integer in the "duration" field updates the duration, with task constraint = As Late As Possible

Avatar

Level 3

 Ahh, the task constraint. Yes that is set to As Soon As Possible which allows you to edit the duration.

Avatar

Community Advisor

Can you post your API call? I just tested it with the task constraint set to ASAP, and with all 4 of the duration types, and my body was

 

{
"duration": 15
}

 

and that worked.

Avatar

Level 3

I apologize but I am not entirely sure what you mean by API call. I am using fusion and I have previously posted screenshots of both the task creation module and the read record module.

Avatar

Level 3

To set the duration in Fusion, you need to work with the "Duration," "Task Constraint," and "Constraint Date" fields, rather than relying on on of the Planned Dates. It's important to understand which Task Constraint you're using, as the "Constraint Date" can relate to either the "Planned Start Date" or "Planned Completion Date" depending on the selected task constraint.

 

For example, I set all my tasks' "Task Constraint" to "Must Start On" in the project template. When Fusion creates the project from this template, I use a router (probably unnecessary, but I like the control).

  • The first module connected to the router updates the "Constraint Date" and "Duration" for all non-parent tasks.
  • The second module (set to run after the first) updates the "Task Constraint" to "Fixed Dates" for all tasks.

Good luck! @RonaldEa Let me know if you need further clarification.