Idea > Story Total Time

jacobspacek
Giga Guru

Is it possible to calculate the amount of time it takes for an idea to become a story?

1 ACCEPTED SOLUTION

Hi @jacobspacek ,

 

Instead of creating datetime, you can create string filed and use below script to update the time taken field.

var dur = new GlideDuration();
dur.setValue(current.sys_created_on); 

var duration2 = new GlideDuration();
duration2.setValue(current.sys_updated_on); 

var answer = duration2.subtract(dur);
current.u_time_taken = answer.getDisplayValue();

 

RunjayPatel_0-1730786611330.png

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

View solution in original post

4 REPLIES 4

Runjay Patel
Giga Sage

Hi @jacobspacek ,

 

OOB you will not get but you can achieve it by custom implementations.

 

1. Create one field called "Idea Time" as datetime field.

2. Create one after business rule and set the time when task filed have story value.

3. Set difference value of created and current time to "Idea Time" field.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

I am testing this solution now.

 

I am having issues getting the business rule to actually populate the new column.

 

Using script tracer I have confirmed that the BR is firing as expected but not populating that new column value?

Hi @jacobspacek ,

 

Instead of creating datetime, you can create string filed and use below script to update the time taken field.

var dur = new GlideDuration();
dur.setValue(current.sys_created_on); 

var duration2 = new GlideDuration();
duration2.setValue(current.sys_updated_on); 

var answer = duration2.subtract(dur);
current.u_time_taken = answer.getDisplayValue();

 

RunjayPatel_0-1730786611330.png

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

Great solution thank you!