Record producer creating duplicated records

raphaelm2
Tera Contributor

Hello Everyone,

I'm trying to create a normal change request from a Record Producer. When I do, it just create multiple records.

After many tests and validations I realized that Servicenow is creating one empty change request for each approver added based on approval definition. If the approval group has no members, it goes right to scheduled and do not duplicate records.

It shows the record gets duplicated at "Change moves to Assess" workflow step of Normal Change Workflow.

 

This is the record producer script:

current.short_description = "Change Request  " + producer.cmdb_ci.name;

current.description = producer.description;
current.justification = producer.justification;
current.impact = producer.impact;
current.risk = producer.risk;
current.reason = producer.reason;
current.implementation_plan = producer.implementation_plan;
current.start_date = producer.planned_start_date;
current.end_date = producer.planned_end_date;
current.backout_plan = producer.backout_plan;
current.test_plan = producer.test_plan;
current.risk_impact_analysis = producer.risk_impact_analysis;
current.assignment_group = 'a158cd3fdb3f44d0f5cf32ffaa9619e4';
current.type = producer.type;
current.setAbortAction(true);

 

 

Any idea?!

6 REPLIES 6

Abhinay1
Giga Expert

Hello Raphael,

Remove the last statement,"current.setAbortAction(true);". This is not required in a Record producer Script

 

Regards,

Thank you, but it's still duplicating.

When you create the new change record, are you using the standard table and workflow? Have you also, modified the flow??

Hi Abhinay,

 

Thank you for your reply!!

My record producer is using the Change_request table.

The workflow is the standard one. I did not changed it at all.