Ad a task to a request?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:13 PM
Is there a way to create an ad hoc task and tie it to the Requested Item (RITM) without it being orphaned? We would need it to update the workflow of the existing request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 08:11 AM
Hi @jasongblack
1st point, it is not recommended to create as task in RITM outside workflow/ flow.
If you want give a try
Logically you need to update the workflow.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 09:39 PM
Hi @jasongblack
You can do it via UI as suggested by @Dr Atul G- LNG , Scripting and with Flow Designer as well. To create a task via script and link it to the RITM and REQ, use below code :
var ritmNumber = 'Enter the RITM number';
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('number','ritmNumber');
ritm.query();
if(ritm.next()){
var gr = new GlideRecord('sc_task');
gr.request_item = ritm.getUniqueValue();
gr.request = ritm.request;
gr.initialize();
var taskId = gr.insert();
For creating it via flow, use Create Catalog Task action https://docs.servicenow.com/bundle/vancouver-build-workflows/page/administer/flow-designer/reference...
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.