Setting task_time_worked.time_worked via flow

Christian Prob2
Tera Guru

Hello,

it's probably super simple but i just don't see it:

I have a flow where one of the flow variables is "effort" with an integer value, representing the effort spend on a task in seconds. Now I want to create a task_time_worked record in the flow.

I get the record created, the user and the task set properly, but for whatever reason, I can't set the time on the record (test runs always come out with time_worked [and/or time_in_seconds] as 0).

 

I use a script to assign the value to the (duration field) time_worked:

 

 

var tWDint = fd_data._1__get_fcr_status.effort*1000;
var timeWorkedDuration = new GlideDuration(tWDint);
return timeWorkedDuration;

 

 
But still the resulting record does show time_worked as 0. 
 
A flow test shows the value correctly:

 

task=xxx
user=xxx
time_worked=4 Minutes
coalesce_fields=

 

 

What am I missing?

 

Thanks, 

Christian

1 ACCEPTED SOLUTION

Sohail Khilji
Kilo Patron
Kilo Patron

see if you can use 

return timeWorkedDuration.toString();

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

View solution in original post

4 REPLIES 4

Sumanth16
Kilo Patron

Hi @Christian Prob2 ,

 

Can you try like below:

return timeWorkedDuration.getDisplayValue();


If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,
Sumanth Meda

Thanks, but that does not work either.

Sohail Khilji
Kilo Patron
Kilo Patron

see if you can use 

return timeWorkedDuration.toString();

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Christian Prob2
Tera Guru

As a follow up note - I ended up logging a ticket with SN support - imho it should work if you have a flow variable of type duration and then assign it to the task_time_worked.time_worked field, which is of type duration. Support confirmed it is not working ootb. I'll update if I hear more details.