- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:36 AM
Hi,
I have developed a catalog item which when filled and submitted would create a Request and RITM under it. Along with this, I want a Catalog Task to be automatically created with a description "Default Task".
I am quite new to Servicenow and unable to find a way to solve this. Please help.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:26 AM
Oh My Mistake.
Try this:
- var gr = new GlideRecord('sc_task');
- gr.initialize();
- gr.request_item = current.sys_id;
- gr.short_description = "Sample Description";
- gr.description = "Sample Description"
- gr.insert();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:49 AM
- var gr = new GlideRecord('sc_task');
- gr.short_description = "Sample Description"
- gr.description = "ABC";
- gr.initialize();
- gr.insert();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:02 AM
Yes, that is correct, please make use of description field also:
- var gr = new GlideRecord('sc_task');
- gr.short_description = "Sample Description";
- gr.description = "Sample Description"
- gr.initialize();
- gr.insert();
Also make the BR onAfter, since you have to wait until the Request Item is created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:12 AM
Hi,
I have created a BR similar to yours but it is not creating a Catalog Task. My instance is a Domain Separated instance. Since, I want this to happen in all domains, I have created the below BR in the global domain.
This is my BR:
What mistake am I doing? Please let me know.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:14 AM
See below script:
- var gr = new GlideRecord('sc_task');
- gr.initialize();
- gr.short_description = "Sample Description";
- gr.description = "Sample Description"
- gr.insert();
Thank you,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:23 AM
Hi Ashutosh,
I have changed the script by pushing the gr.iniatialize(); to the second line. But, still the Catalog Task is not getting created.