- 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 06:29 AM
Hi,
It could be either, but by the looks of it, it should be a business rule that runs on insert.
-Anurag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2020 06:29 AM
Hi,
create a Business Rule and add the following code as example:
var gdt = new GlideDateTime(current.opened_at);
gdt.addHours(2);
current.u_cpc_date_time=gdt;
If I have answered your question, please mark my response as correct and/or helpful.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2020 07:21 AM
Thanks for your reply, this is populating the field but with the exact same time as the opened_at time, no difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2020 07:31 AM
Thanks Alberto