Business Rule is updating previous value on task table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 05:08 AM
Hi Team my requirement is that I have to create one catalog item and on that catalog item I don't need to show all variables on portal but I am showing all variables on request and some of the variables on task, now requestor wants to update task variable value on task description.
I have written before update BR -
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.request_item);
set.load();
var vs = set.getFlatQuestions();
var description = '';
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && vs.get(i).getDisplayValue() != 'false') {
description = description + vs.get(i).getLabel() + " : " + vs.get(i).getDisplayValue() + "\n";
}
}
current.description = description;
Issue is that it's updating previous value not the value which I change currently.
For ex - I changed Priority to high on task variable it will not do anything
But next time I changed it to critical then on task description it will be showing as high
Please advise, thanks in advance
})(current, previous);
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 09:28 AM
What is nog working? The entire BR, or do you still get the previous values?