copy RITM variables to Catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2024 10:48 AM
I want to populate catalog item variables on catalog task. these catalog item variables are visible on RITM but not on assosciated catalog task.
I wouldnt be able to use slush bucket in work flow/flow designer. Is there any other approach?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2024 11:16 AM
I have gone to variables table and made the variables global as suggested. Now the problem is the variables that are hidden on catalog item are visible on ctask. i checked the ui policies and catalog client scripts. nothing i find in it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2024 11:23 AM
Hi @NiloferS,
please check below script:
(function executeRule(current, previous /*null when async*/) {
var ritm = current.request_item.getRefRecord();
if (ritm) {
var variables = ritm.variables;
for (var i in variables) {
if (variables.hasOwnProperty(i)) {
var variableName = variables[i].name;
var variableValue = variables[i].value;
if (current.variables.hasOwnProperty(variableName)) {
current.variables[variableName] = variableValue;
}
}
}
}
})(current, previous);
Thank you, please make helpful if you accept the solution.