Copy variables (from variable editor) from RITM/TASK to Story using UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2023 08:17 AM
Hi,
We have a UI Action 'Create Story' on RITM and Tasks. When user clicks on it, a new story will be created and RITM/Task will be closed. The new requirement is to capture the variables from RITM/Task (part of variable editor - comes from catalog item) and copy them to new tab on the story for variables. How to achieve this requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2023 05:52 AM
A Catalog Item has variables defined. The Requested Item and any Catalog Tasks that get created when a request is submitted have access to the variables, but it's always the same set of variables - whether the variable appears or is hidden on the form, it's still a part of the variable object for the parent. This is why only RITM records appear on the sc_item_option_mtom table - adding each/any sc_task records would be redundant, so you should be able to do the same from a sc_task UI Action, changing the addQuery line to:
ritmVar.addQuery('request_item', current.request_item);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2023 06:53 AM - edited ‎03-20-2023 06:54 AM
Thanks @Brad Bowman
If I change the code like mentioned above, it will query RITM through SCTASK and fetch RITM variables, but I need the variables present on SCTASK form. We have many catalog items where some variables are visible only on SCTASK, but not on RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2024 06:10 AM
Hi @Brad Bowman / @sath , we have a similar requirement.
We have variable editor on a HR case , and when we clone the case ui action we need to copy the variable editor to the new case.
Could you please share the script with me.
TIA