- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 03:58 AM
Hai Guys,
please help me in the scripting, im new to servicenow,
i have 2 tables, if i change "State" field value of request item table as per sc_task table.
please give any script
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 04:10 AM
You can use after Business Rule on sc_task table
Condition
state changes
Script
var ritmGr = new GlideRecord('sc_request_item');
ritmGr.get(current.getValue('request_item'));
ritmGr.state = current.getValue('state');
ritmGr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 11:28 PM
//To Close RITM
var ritmGr = new GlideRecord('sc_request_item');
ritmGr.get(current.getValue('request_item'));
ritmGr.state = current.getValue('state');
ritmGr.update();
//To Close Request
var reqGr = new GlideRecord('sc_request');
reqGr.get(current.getValue('request_item.request'));
reqGr.state = current.getValue('state');
reqGr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2022 12:45 AM
Please mark my response as correct, if it resolved your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2022 11:42 PM
Please close this thread my marking the appropriate response as correct so that others readers can also benefit from it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 04:51 AM
Please close this thread my marking the appropriate response as correct so that others readers can also benefit from it.