Problem number not visible after incident record creation

Shubham_verma
Tera Contributor

Hi,

I want to create a business rule for when a incident record is created ,a problem record should also get created.

Its working fine ,but when I am trying to populate a message a new problem ticket is created,it is not showing problem record number.

(function executeRule(current,
_previous) {
var x = new GlideRecord('problem');
x.category = current.category;
x.short_description = current.short_description;
x.cmdb_ci = current.cmdb_ci;
gs.addInfoMessage("A problem ticket is created "+x.number);
x.insert();
})(current, previous)