How to insert description information with bullet points using scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2023 12:30 PM
Hi,
I have created scheduled job which will create ptask with short description and description. Now at that time description information should be created as bullets points like 1,2,3 .. etc. I am looking the below var par should be inserted as points after each comma. How can I achieve this?
var par = 'Please complete the following before 4:00pm ,Export CDSS and Network Tapes from tape library, Log in to SecureSync and complete Distribution List,Place tapes in case and lock.,Place on the IT bookcase for pickup';
var ptask = new GlideRecord('u_property_it_tasks');
ptask.initialize();
ptask.short_description = 'Prepare Tapes for Iron Mountain';
ptask.description = par.split('');
ptask.assignment_group = 'b0ead3a0dba02b80a2b63437b996192d';
ptask.priority = '3';
ptask.insert();
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2023 01:35 AM
Hi @reddy8055
Try below code:
var par = 'Please complete the following before 4:00pm ,Export CDSS and Network Tapes from tape library, Log in to SecureSync and complete Distribution List,Place tapes in case and lock.,Place on the IT bookcase for pickup';
var parSplit = par.split(',');
var desc = '';
var count = 1;
for (var i=0; i<parSplit.length; i++)
{
desc = desc + count + '. ' + x[i] + '.' + '\n';
count = count + 1;
}
var ptask = new GlideRecord('u_property_it_tasks');
ptask.initialize();
ptask.short_description = 'Prepare Tapes for Iron Mountain';
ptask.description = desc;
ptask.assignment_group = 'b0ead3a0dba02b80a2b63437b996192d';
ptask.priority = '3';
ptask.insert();
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2023 03:38 AM
Hi @reddy8055 ,
Use the code of @AnubhavRitolia it will work but just u need to do small change in the code i.e in the place of x[i] give parSplit[i] then it will work.
Please mark as helpful/correct if it solves your issue.
Regards,
Kalyan