
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 02:01 PM
I need to create a new field named "End time" on a form (Application Inventory). I want this filed to be populated by end date value on the change request form based on a combination of the CI and the category. If a specific category and Configuration Item is selected for on a change ticket, the end date for the change should be populated on a new field on the application inventory form called "change end date"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2024 03:43 AM
|Hi @Community Alums
What is use case of showing end time on application inventory. better to add change as related list and get the all information on one place.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 06:40 PM
Hi @Community Alums
Maybe a BR like this should work -
(function executeRule(current, previous /*null when async*/) {
try {
var ci = current.getDisplayValue("u_ci"); // CI from the change request
var category = current.category; // category from the change request
var appInvGr = new GlideRecord('u_application_inventory'); // replace with your Application Inventory table name
appInvGr.addQuery('u_ci', ci); // filtering by CI
appInvGr.query();
if (appInvGr.next()) {
appInvGr.u_change_end_date = current.u_end_date; // Populating the "change end date" field
appInvGr.update();
} else {
gs.info('no matching record found in Application Inventory for CI: ' + ci + ' and Category: ' + category);
}
} catch (ex) {
gs.error('Error updating Application Inventory record: ' + ex);
}
})(current, previous);
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2024 05:00 PM
dont use try/catch on buss.rules as the java class responsible is actually doing it for us for buss.rules

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2024 04:20 PM
I will try this tomorrow and let you know. Thank you for the prompt response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2024 04:28 PM
How do I add the change end date field to the application inventory form?