Copy variables (from variable editor) from RITM/TASK to Story using UI Action

sath
Tera Expert

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?

 

7 REPLIES 7

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);

 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.

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