- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2020 05:32 PM
Hi All,
There are multiple snippets of attempted answers scattered across the community forum on this topic.
Can anyone be kind enough to help illustrate the steps involved in configuring the auto-close of HR cases after 5 business days if they have been in "awaiting acceptance" state? Can you please share screenshots of the new System Property and Scheduled Job created to accomplish this task? Many thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 07:09 AM
To piggy-back off what Michael said, as he is correct.
When you go to the workflow editor, you will need to checkout the workflow to actually edit the timer.
Just in case you are unsure as how to do so:
- type workflow edit in your filter nav and click on workflow editor
- when on the workflow url page, on the right you have your search field, type in HRI to location the workflow Michael mentioned HRI Case User Acceptance
- click on that workflow, and on the left side of the workflow, use the additional menu options to checkout the workflow
- Once checked out by you, locate the Timer step and double-click to get into it
- adjust your timer as needed
- then go back to the addition menu to publish the workflow
(ours as an example)
Now, someone might need to sanity-check me, but I think once you adjust this timer and republish the workflow, the new timer will only start with NEW cases hitting the conditions. Existing cases already using the previous timer will still use the previous timer.
Please let us know if you need more help with this, or if we have answered your question.
Cheers!
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2020 06:00 PM
Hi,
You need to create a scheduled job to do this. Create a custom property in the "sys_properties" table. Add integer value "5" in that property.
Based on that create scheduled job run periodically (or) daily basis with the following script:
closehr_case();
function closehr_case() {
var cd = gs.getProperty('put your property name here ');
var ud= parseInt(cd);
if (pn > 0) {
var sh = new GlideRecord('sn_hr_core_case');//add your h
sh.addQuery('state', '6');//replace your awaiting acceptance state value
sh.addQuery('sys_updated_on', '<', gs.daysAgoStart(cd));
sh.query();
while (sh.next()) {
sh.state = '10';//replace with closed complete value
sh.comments = 'your HR Case automatically closed after ' + ud + ' days in the Awaiting acceptance state.';
sh.active = false;
sh.update();
}
}
Please mark it as helpful (or) correct if it helps.
Thanks,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2020 08:32 PM
Thanks Sumanth.
Can you please detail the steps for creating the custom property? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 05:31 AM
Hi ,
Go to sys_properties.LIST table in left navigator.
Click on create and and declare Type as "Integer" and in the value field put 5.
It will work.
If you want example you can check auto close system property in sys_properties table.
Please mark it as helpful 9or) correct if it helps.
Thanks,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2020 03:51 PM
In the code, can you please explain:
if (pn > 0){
What is this line of code doing?
Thanks again.