Update the work notes if the variable changes in SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 07:13 AM
If change the “request type” on the ticket, it should automatically update the work notes of SCTASK to “request type has been changed”.
Please help me with the Business rule
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 07:24 AM
Hi siva
Write a Business rule/Client script Which will check the values of variables.
BR: Before update on sc_task
Condition: current.variables.changes() && current.request_item.cat_item.name == 'Catalog Item Name/sysid here'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.work_notes = 'request type has been changed';
})(current, previous);
client script:
you can write onChange Catalog Client Script on that variable for your catalog item
1) Applies on CTASK's.
2) Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(oldValue != newValue)
{
var str = 'Request type changed';
g_form.setValue('work_notes', str);
g_form.save();
}
}
Refernce links : https://community.servicenow.com/community?id=community_question&sys_id=ee019ba9db2f2090fb115583ca96...
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 07:33 AM
Hi
So you are going to keep variables editable on RITM? For e.g Request Type and people will change in manually during lifecycle of RITM?
Thank you
Prasad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 07:36 AM