Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Automate a custom duration field change as time moves on

Highlighted
win_a_penny
Regular Collector

Automate a custom duration field change as time moves on

Hi all,

I have created a custom date/time field, just name it "DateA". Is it possible to have a custom duration field, "DurationB", such that:

DurationB = DateA - (current system time)

One good example is the out-of-box "To Deadline" field which OVSD calculate as:

To Deadline = Deadline - (current system time)

This "To Deadline" field will automatically change according to the system clock; i.e. the value of this field changes every second.

However, I can only set DB rule to automate the calculation of "Duration B" once or twice base on certain event criteria, but not continuously. Using Calculated Fields is also not suitable as this feature only support formulae such as:

Custom calculated field = Another field +/- a constant.

Please advice.

Vincent.

5 REPLIES
Robert S. Falko
Honored Contributor

Re: Automate a custom duration field change as time moves on

Vincent,

Create a custom field that is updated by the DB rule. Include a change in that field as one of the trigger criteria for the DB rule. That way, each time the rule is executed, it will automatically trigger its next execution.

-Josh
win_a_penny
Regular Collector

Re: Automate a custom duration field change as time moves on

Hi Josh,

I don't quite get your meaning. Can you explain more about your method and how does it relate to the current system time?

Vincent.
Robert S. Falko
Honored Contributor

Re: Automate a custom duration field change as time moves on

Vincent,

I understand your situation as follows:

In order to periodically update a duration field, you have a DB rule:
>>However, I can only set DB rule to
>>automate the calculation of "Duration B"
>>once or twice base on certain event
>>criteria, but not continuously.

I presume that this rule is triggered by the creation of an item and/or a change in status of that item.

I presume also that you have a duration field that is being updated by your DB rule.

Add to your trigger for the DB rule any change in that duration field.

Your DB rule is triggered. Suppose it is executed 1 minute later. When it executes, it updates your duration field. However, the update of the duration field will trigger the same rule again.

This will continue until some other trigger criteria (for example, status) becomes false.

You will set the periodicity of the update in the DB rule where you fix the delay for execution.

I hope this is clearer to you.

-Josh
win_a_penny
Regular Collector

Re: Automate a custom duration field change as time moves on

Hi Josh,

Tried your suggestion but still the field is updated only once ...

Did you ever encountered into the same situation before?

Vincent.
Robert S. Falko
Honored Contributor

Re: Automate a custom duration field change as time moves on

Vincent,

It might help if you post your DB rule.

-Josh
//Add this to "OnDomLoad" event