- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2024 08:20 AM
Is it possible to calculate the amount of time it takes for an idea to become a story?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2024 10:03 PM
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();
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2024 08:51 AM
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2024 11:30 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2024 10:03 PM
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();
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2024 06:12 AM
Great solution thank you!