- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 12:47 AM
Can anyone help me @Vasantharajan N @Ankur Bawiskar
As I need to display change request number in ritm description filed once change request is created
Tried with Business Rule and the condition is when the change state is in New.
But not able to get the Change Request number.
Business Rule:
var chnGr_sysId = current.change_request.toString();
var riTs = new GlideRecord('sc_req_item');
riTs.addQuery('parent', chnGr_sysId);
riTs.addActiveQuery();
riTs.query();
if (riTs.next()) {
riTs.description = current.number.toString();
chGr.update();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 03:41 AM
@Arjun Reddy Yer - Please try this code and let us know.
var chnGr_sysId = current.sys_id.toString();
var riTs = new GlideRecord('sc_req_item');
riTs.addQuery('parent', chnGr_sysId);
riTs.addActiveQuery();
riTs.query();
if (riTs.next()) {
riTs.description = current.number.toString();
riTs.setWorkflow(false);
riTs.update();
}
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 02:14 AM
It's not working actually once the RITM is approved then SCTASK and Change Request are getting created automatically.
So in RITM description Change Request number should be populate.
When I keep the Business Rule to run before then it's not working changed to run after also it's not working.
Business Rule:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 02:36 AM
@Arjun Reddy Yer Please increase the order to 2000 and try.
- Kailas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 02:38 AM
@Arjun Reddy Yer In the RITM, parent field should be select as Change Number
- Kailas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 02:44 AM
still not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 03:15 AM
Hi @Arjun Reddy Yer ,
try writing insert BR on "change_request" table instead of RITM and then use following code
var chnGr_sysId = current.sys_id;
var riTs = new GlideRecord('sc_req_item');
riTs.addQuery('parent', chnGr_sysId);
riTs.addActiveQuery();
riTs.query();
if (riTs.next()) {
riTs.description = current.number.toString();
riTs.update();
}
Please Mark it as correct/helpful if this helps you.
Thanks,
Akshay
