- 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 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 04:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 05:01 AM
Line no. 4 is wrong
it is 'request_item' not req_item and it should be under quotes ' '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 05:41 AM
one more point is now, If the CTASK is closed complete, the state of RITM and REQ(field-'request state') state also need to closed complete.
can you please help
thankyou