hrtest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2024 08:42 AM - edited ‎04-09-2025 09:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2024 09:01 AM
@nikhitha24 You can write an onBefore Update business rule on sn_hr_core_case table with condition HR Service is Travel AND State Changes to Closed Complete. In the business rule script, you can create a new HR case as follows.
var hrCase = new GlideRecord('sn_hr_core_case');
hrCase.initialize();
// Set mandatory and required fields
hrCase.short_description = "Example HR Case Created via Script";
hrCase.description = "This HR case is created via a script for demonstration purposes.";
hrCase.opened_for = "6816f79cc0a8016401c5a33be04be441"; // Replace with the sys_id of the user
hrCase.hr_profile = "eb106f19c0a8016401c5a33be04be444"; // Replace with the user's HR profile sys_id
hrCase.hr_service = "92c63f19c0a8016401c5a33be04be552"; // Replace with the sys_id of the HR service
// Insert the record into the HR case table
var caseSysId = hrCase.insert();
if (caseSysId) {
gs.info("HR Case created successfully with sys_id: " + caseSysId);
} else {
gs.error("Failed to create HR Case.");
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2024 02:10 AM - edited ‎04-09-2025 09:07 AM
t

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2024 03:10 AM
@nikhitha24 You can put a condition inside the business rule script and check the HR Service and accordingly set enquiry type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 01:08 AM - edited ‎04-09-2025 09:07 AM
t