How to get populate "incident" creation date on "incident_task" one date/time field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 08:01 AM
HI all,
I am getting struck with populating "incident" cretion date/time in to another table "incident_task"
for this i have written after BR .Please find the below script
@I have checked that gs.log('incident creation date:' +current.sys_created_on); in this log current.sys_created_on is not comming on logs
(function executeRule(current, previous /*null when async*/) {
current.sys_created_on = current.u_original_date;
gs.log('incident creation date:' +current.sys_created_on);
var inc_dte = new GlideRecord('incident_task');
inc_dte.addQuery('incident',current.sys_id);
inc_dte.query();
gs.log('incident records match:' +current.sys_id);
if(inc_dte.next()){
current.u_original_date = inc_dte.u_original_date;
gs.log('incident original date:' +inc_dte.u_original_date);
inc_dte.update();
}
})(current, previous);
Can anyone help on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 08:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 08:22 AM
1. check if the incident in the incident task exists during create or update?
2. if its on create, then ensure your BR is afer insert. otherwise, have it after update.
Before BR does not work here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 08:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 08:28 AM
and is this BR created on incident_task table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 08:33 AM
That could be the problem of your query not matching.
Kindly check first why incident task is not getting the correct incident number there.