06-17-2014 04:30 AM
In Incident ticket am calculating outage like Outage=Downtime End - Downtime Start and am getting output in 3 15:36:00 this format. 3 days 15 hrs 36 min.
I have a requirement of calculating outage below format
(3*24) + 15 = 87
Please help me with FC calculation or a java script to achieve the above requirement.
Thanks in Advance.
06-17-2014 06:20 AM
Not sure if there is easy way to do that (can not imagine of any atm) but you could cut last 9 symbols from it (it will leave only days for you ) to multiply by 24 and then cut 6 symbols to get the hour part. There might be a function to do that normally but i can not revise any.
06-18-2014 12:26 AM
Here is a bit "clumsy" solution but it should work for you
var fstring= vars.$file.FIELD_NAME;
vars.$length = system.functions.lng(fstring);
Instead of FIELD_NAME input the name of the field which carries value 3 15:36:00 (if the field name has "." replace them with "_" like in my example)
In the end instead of FIELD_TO_RECORD_RESULT set the field name in which must be recorded 87.
This should be put to the format control JS tab as it works with $file variable