- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 06:25 AM
Hi all,
I hope this is an easy one to get solved,
Im after populating a field (u_cpc_date_time) with the time of '2 hours' after the opened_at time when a ticket is opened,
so...if a ticket was opened at 13:00, the 'u_cpc_date_time' field would display 15:00, im not sure if this is a business rule or a client script so any help would be great.
Thanks
Matt
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 07:30 AM
Full solution,
var gdt = new GlideDateTime(current.opened_at);
gdt.addSeconds(7200);
current.u_cpc_date_time=gdt;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 07:29 AM
Hi,
I figured it out, I changed the
gdt.addHours(2);
to
gdt.addSeconds(7200);
this is no populating correctly,
thanks for your answers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 07:30 AM
Full solution,
var gdt = new GlideDateTime(current.opened_at);
gdt.addSeconds(7200);
current.u_cpc_date_time=gdt;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 07:31 AM
Cool,
If I helped you in some way, please mark my response as helpful.
Thank you very much
Cheers
Alberto