Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 12:16 PM
Try this:
Set 'Positive Response' as default value for the 'customer response' and create only one after business rule as below:
In the Advanced script add:
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('asmt_metric_result');
gr.addQuery('instance', current.instance);
gr.query();
while(gr.next()){
gr.u_customer_response = 'negative'; // assuming your field name is 'u_customer_response' and value is negative for negative response
gr.update();
}
})(current, previous);