<h2>CMDB Dashboard Compliance Audit - Task not getting creation for failed audit.</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul style="list-style-position: inside;"><li>An audit for a CI class is set for populating the audit scores on CMDB dashboard but we could not see any tasks being created. </li><li>OOTB, when an Audit is failed, it should create a task for the failed audit. Below is the<span style="background-color: #ccffcc; color: #008000;"> <strong><span style="text-decoration: underline;">expected outcome of Audit</span>.</strong></span></li></ul> <p style="padding-left: 80px;"><img style="border: 2px solid black; align: baseline;" src="https://support.servicenow.com/b42d94dcdbd99410d82ffb2439961935.iix" alt="NR Int.png" width="1457" height="713" align="baseline" border="2" /></p> <p style="padding-left: 80px;"><br /></p></section></div><div ><h3 >Cause</h3><section><ul style="list-style-position: inside;"><li>It was a working set up but after a recent clone, the system stopped creating tasks for Audit.</li><li>On checking the <span style="text-decoration: underline;"><strong>system</strong></span> logs, we can see below error reported while executing the Audit Scheduled Job.</li></ul> <pre style="padding-left: 80px;">Error FAILED TRYING TO EXECUTE ON CONNECTION glide.18 (connpid=74334): com.glide.db.BatchStatement$StatementContainer@17d0b1d,com.glide.db.BatchStatement$StatementContainer@1832703<br />java.sql.BatchUpdateException: (conn=74334) Duplicate entry 'TASK0591107' for key 'task_U1'<br />: java.sql.SQLException: java.sql.BatchUpdateException: (conn=74334) Duplicate entry 'TASK0591107' for key 'task_U1': com.glide.db.StatementBatcher.getSQLException(StatementBatcher.java:547)<br />com.glide.db.StatementBatcher.commitBatch(StatementBatcher.java:502)<br />com.glide.db.StatementBatcher.commitAllOrNothing(StatementBatcher.java:377)<br />com.glide.db.DBCompositeAction.executeAsBatch(DBCompositeAction.java:193)<br />com.glide.db.DBCompositeAction.executeChunk(DBCompositeAction.java:136)</pre> <ul style="list-style-position: inside;"><li>The system is trying to create the task in the backend but due to the limitation on available numbers on TASK was failing.</li></ul></section></div><div ><h3 >Resolution</h3><section><ul style="list-style-position: inside;"><li>In order to fix this issue, below steps can be followed.<br /><br /> <ul style="list-style-position: inside;"><li>Go to System Definition > Number Maintenance</li><li>Click New.</li><li>Table: Follow On Task</li><li>Prefix: FNTASK (OR some unique string that they want for this numbering)</li><li>Number: 10,000</li><li>Number of Digits: 7 </li></ul> </li></ul> <p style="padding-left: 80px;"><br /><img style="border: 2px solid black; align: baseline;" src="sys_attachment.do?sys_id=6923e9fcdb81b41066e0a345ca961931" width="1457" height="453" align="baseline" border="2" /><br /><br /></p> <ul style="list-style-position: inside;"><li>After following the above steps, the system will not throw any error, and the audit result will successfully create task.</li><li>Please refer to "<a title="Record Numbering" href="https://docs.servicenow.com/csh?topicname=c_ManagingRecordNumbering.html&version=latest" target="_blank" rel="noopener noreferrer">Record Numbering</a>" document for more details.</li></ul></section></div><div ><h3 >Related Links</h3><section><ul style="list-style-position: inside;"><li>In case any recent clone is performed and the audit is not working then it is advised to try creating a fresh Audit <a title="Certification Filter" href="https://docs.servicenow.com/csh?topicname=t_CreatingFilters.html&version=latest" target="_blank" rel="noopener noreferrer nofollow">Certification Filter</a> and Audit <a title="Certification Template" href="https://docs.servicenow.com/csh?topicname=r_ServiceNowPlatform.html&version=latest" target="_blank" rel="noopener noreferrer nofollow">Certification Template</a>.</li><li>Most of the time, it starts working once a new filter and template is created.</li><li>These steps help to narrow down the problem statement. </li></ul></section></div></article></div>