Create a catalog task based on requested item variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 03:58 AM
I have a requirement to create a catalog task based on a requested item variable:
The catalog item is for users to use when staff are leaving, but the issue I have is that all the tasks are generated at the time of the request being submitted (normal behavior) but in some cases this can be for example a month in the future and then we have tasks sitting in queues for say a month with no action needed.
Is it possible to generate these tasks based on the date used on the catalog form?
So if for example someone is laving on the 01/05/23 then these tasks are created at that time.
Hope this is clear any ideas or suggestions would be greatly appreciated
Thanks
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2023 08:41 PM
seems the date format is the issue. try to convert it into YYYY-mm-DD
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 01:05 AM - edited 05-09-2023 01:08 AM
Hi Ankur,
So I've updated the script as suggested but the tasks are still being generated?
so script now reads:
var terminationDate = current.variables.termination_date.getDisplayValue();
var formatdate = day.getByFormat("yyyy-MM-dd");
gs.info("Termination Date" + terminationDate);
answer = gs.dateDiff(new GlideDateTime(), terminationDate, true);
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 02:01 AM
is that the complete script?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 02:09 AM
yes it is, am I missing something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 04:52 AM
Hello,
Please refer the below links.
Please mark my answer as helpful/correct if it helps you.
Regards,
Devender