Creation of auto problem record is missing few fields with current.getUniqueValue

roshini1
Kilo Guru

Hi Team,
am writing the below before BR in incident table for creating a problem record for inc which moves to resolved state, am able to get the problem record creation, but first reported by(field inside problem record) and problem id( field inside inc record) is not getting mapped. The same code is working in my PDI, but not in my dev instance.(highlighted code in red is not working in dev instance but working in my pdi)
Can someone please suggest the modifications that is required

var prbGR = new GlideRecord("problem");
prbGR.initialize();
prbGR.description = current.description;
prbGR.short_description = current.short_description;
prbGR.cmdb_ci = current.cmdb_ci;
prbGR.impact = current.impact;
prbGR.urgency = current.urgency;
prbGR.priority = current.priority;
prbGR.company = current.company;
prbGR.business_service = current.business_service;
prbGR.service_offering = current.service_offering;
prbGR.sys_domain = current.sys_domain;
prbGR.first_reported_by_task = current.getUniqueValue();
prbGR.insert();
current.problem_id = prbGR.sys_id;
gs.addInfoMessage(gs.getMessage("Problem {0} created", prbGR.number));
action.setRedirectURL("incident.do?sys_id=" + current.sys_id.toString());

1 ACCEPTED SOLUTION

Thank you so much for investing time on this. I found the issue. It was with setting the display value to true for a different field in the problem table instead of number field. Once the change is made to the table level columns the issue got resolved.

View solution in original post

7 REPLIES 7

 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

sushantmalsure
Mega Sage
Mega Sage

did you also check logs if there is something flagged related to this business rule execution?

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

can you please help me out with the log code which needs to be used