"Suspend Case" button on HR Task (Workspace)

miro2
Mega Sage

Hi,

 

I'm looking for more information about "Suspend Case" UI Action available on HR Task. 

Suspend HR case action is available on active tasks when the parent HR case is not suspended or closed but my concern is that button is visible on the task form before submission (parent HR Case state is "Work in Progress").

 

Why does "Suspend Case" button become visible when creating an HR Task (before submitting it)? Its not visible when parent HR Case state is "Draft" or "Ready".


HR Case on HR Agent workspace

miro2_0-1707131886751.png

 

HR Task before submission

miro2_1-1707131886820.png

Is this expected behavior and is it working by design or should "Suspend Case" button only by visible once the task is submitted?

13 REPLIES 13

Community Alums
Not applicable

Hi @miro2 ,

That's by design, but if you want to tweak the logic, then you will need to make the modification in the UI action script.

 

@miro2  i dont see this in my PDI. Can you mention the steps to reproduce this. 

 

Pranesh072_0-1707147865967.png

 

@Pranesh072 

Parent HR case should be in state Work in progress. Then use Add task and you will see button. I already mentioned that in my first post. Please check and let me know 

Uday Kumar1
Tera Contributor

when HR case is suspended for a specific date and when the date is coming because of the scheduled job its coming work in progress at the time mentioned in the scheduled job. because of that we are loosing SLA based on country. Instead of scheduled job we have created one after query BR where it will calculate the time from the suspended date to fallow up date. But it is not working as expected. what would be the best practice to create this type of requirement.

 

 

(function executeRule(current, previous /*null when async*/) {
// Define HR case record to check for suspended state
var hrCase = new GlideRecord('sn_hr_core_case');
hrCase.addQuery('state', '24'); // Suspended state
hrCase.query();

while (hrCase.next()) {
// Get the suspend reason and extract the resume interval
var suspendReason = hrCase.getValue('u_follow_up_date');
var resumeInterval = suspendReason.match(/\d+/)[0]; // Assuming number of hours is a single integer

// Check if the resume interval has passed
var resumeTime = new GlideDateTime(hrCase.sys_updated_on.getGlideObject().getNumericValue() + resumeInterval * 60 * 60 * 1000); // Calculate the resume time based on the last update time and resume interval
if (resumeTime.before(new GlideDateTime())) {
// Resume the HR case by setting the state to 'In progress'
hrCase.setValue('state', '2' /*In progress*/);
hrCase.update();
}
}

})(current, previous);

 

 

Thanks,

Uday Kumar