case number is empty for few HR cases created through scheduled job

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 10:07 AM
HI Team,
I have below scheduled job which auto create HR cases.
HR case has been created in prod with empty case number like below.
All are auto triggered cases but only few cases are showing empty case numbers, How to fix this kind of issues?
How to stop cases creating empty case numbers
- Labels:
-
Case and Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 12:03 PM
Hi Poojitha,
Can you check link once. As it has something similar to what you are facing.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 12:17 AM
Hi Jaspal Singh,
Number is missing in few HR cases which is random rest all HR cases are working as expected.
Do you have any idea why HR case number is missing only in few cases ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 11:21 PM
Seems some issue with initialization , just to make sure their are no empty case number inserted, please check the value in qc.number before inserting and after initialization , if found bank call initialization again else continue to insert.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 02:52 AM
Hi Sharad,
Could you please help me correcting this code to check qc.number
CreatingCase();
function CreatingCase()
{
var qc = new GlideRecord('sn_hr_core_case');
qc.initialize();
qc.contact_type='Auto Trigger';
qc.opened_for = 'Medha Lakshmi';
qc.priority='3-Medium';
qc.hr_service = '4db763a4dbc53a00e907572e5e9619c5';
qc.short_description='IND - New hire data';
qc.description='*New hire list sent to Insurance vendor & ADP vendor ';
qc.insert();
}
I Hope qc.number will auto generate once after you insert the record. not sure how to check before record insertion.