Close Catalog task automatically from workflow servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 12:51 AM
Hi,
We have a requirement where we need to close the task from workflow in servicenow. I have tried using below script but its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 01:00 AM
The 'number' of your task isn't the sys_id of the current task, I assume? Depending on which table the flow is running, you will need to look for the reference field containing that variable (sysID).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 01:24 AM
Hi @Mark Manders :- Number is the field in the catalog task and flow is running on request item table
ctask.addQuery('number',request_item); // request_item is the reference field in catalog task table. Is that correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 04:22 AM
What?
You need the field that holds the sys_id of the requested item. How is that ever the number field of the catalog task? Assuming you are OOB:
ctask.addQuery('request_item',sysID);
And also check your update, because updating the description with 'auto close task' will override the content of that field. Why not update the worknotes with this update?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark