- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-16-2021 10:03 PM
Need to set value of choice list field which is present on change task when change request is change .
when change move from one state to another .set choice field value in change task .
Example:
if change task has choice field "abc" with value as 1,2,3. also change state is in authorized state and task choice field abc value is 2.when change is moved from authorized to schedule state "abc" value should switch from 2 to 1.
How to implement this scenario.
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-17-2021 02:36 AM
Hi,
BR should be on change_request table
Condition:
State [Changes From] Authorized
AND
State [Changes To] Scheduled
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var chgTask = new GlideRecord('change_task');
chgTask.addQuery('change_request', current.sys_id);
chgTask.query();
while(chgTask.next()){
chgTask.u_confirmation = 'released';
chgTask.update();
}
})(current, previous);
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-16-2021 10:07 PM
Hi,
you can use after update BR on change_request table and update the change_task fields
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-17-2021 01:25 AM
I have tried using after business rule but could not achieve this do i need to glide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-17-2021 01:39 AM
Hi,
please share the script you tried
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-17-2021 02:08 AM
Hi
As my requirement is when change is moved from authorized to scheduled state. on change task confirmation field value also changes from confirmed to released.
---------------------------------------------------------------------------------------------------
Previous i have tried after update business rule of change_task table
Filter condition: change.request.state changes from authroized.
confirmation is confirmed
Script: current.u_confirmation = 'released'.
but this was not working as in after update BR changeto and changefrom condition are not working.
---------------------------------------------------------------------------------------------------
now I have written Before update Business rule
Filter condition: state changes from authorize.
Script:
(function executeRule(current, previous /*null when async*/ ) {
var grChgtask = new GlideRecord('change_task');
grChgtask.addQuery('u_confirmation', 'confirmed');
grChgtask.query();
while (grChgtask.next()) {
grChgtask.u_confirmation = 'released';
grChgtask.update();
}
i am not sure what business rule will be used or i need to handle using script include?