- 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:38 AM
Hi,
You can create this using catalog task activity in workflow attached to your Catalog item.
There you can set short description of your activity as well.
Thank you,
Ashutosh
Please Hit ✅Correct, âÂ��Helpful, or ��Like depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:40 AM
Hi Prudhvi,
You can make use of Task Activity by building a workflow, for which scope of scripting is very less.
else:
You can create a Business Rule on sc_req_item table and write this script. Make sure you restrict this Busienss Rule only to this catalog item.
- var gr = new GlideRecord('sc_task');
- gr.initialize();
- gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:47 AM
Hi Govind,
Thanks for the reply.
I am trying to use your BR. However, I also want to add a description into this. For this, can I add the following line to the code?
- var gr = new GlideRecord('sc_task');
- gr.short_description = "Sample Description"
- gr.initialize();
- gr.insert();
Is this right? And, Should the BR be an After Insert, Update ?
Please let me know. Thanks.