Current number value is not being passed to Catalog task's Request Item field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:07 AM
Hi All,
I have a small button on the Requested Item, which allows me to create ad-hoc task and relate it to the current RITM:
var catalogtask = new GlideRecord("sc_task");
catalogtask.short_description = "Any other equipment - WEEE ticket";
catalogtask.description = "Please list all additional not registered devices in a flied 'Any Other equipment' ";
catalogtask.assignment_group = "af7227d6db57c410bf0e5858dc961925";
catalogtask.request_item = current.number;
var sysID = catalogtask.insert();
current.sc_task= sysID;
gs.addInfoMessage("WEEE " + catalogtask.number + " for any other equipment has been created");
action.setRedirectURL(catalogtask);
I did not change anything in this script in the last 4 months, but I noticed that
catalogtask.request_item = current.number;
is not passing the correctly number to the Request Item field on the new task:
Can any advise what is going on, I can't figure it out.
I tried add .getDisplayValue(), and I can pass it to any string field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:11 AM
try passing sys_id instead of number, because "request item" is a reference field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:14 AM
**bleep** it, it tried before, but I though I am going to give it once again a go, it works! Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:23 AM
Actually, it now pass the value, but when you try to save it, it disappears
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:14 AM - edited 04-17-2024 07:25 AM
Hi @mattmg
I have modified your code, please use below code
This will definitely helps you to resolved your issue. Let me know in case you need to understand the flow or you can DM on LinkedIn.
If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.
Best Regards,
Krushna Birla