Closing a HR case automatically after last task is closed

Thedavisrun
Mega Expert

I have a record producer that creates a HR Case.  This HR case has an associated HR Service which has two tasks tagged on to it.  I would like to set it in a way where when the last task is completed the Hr case is automatically set to closed (or awaiting acceptance).

Is this possible? 

I don´t mind any type of solution but i thought this was something that could be done OOTB with New York.

1 ACCEPTED SOLUTION

Hi,

I believe we can do it in few ways:

1) Async Business rule on task table.

2) Editing and managing workflow.(Bit tricky and might not be good)

3) Use gs.sleep in business rule so that it will run ur code bit late i.e after 3 4 secs.

Thanks,
Ashutosh

View solution in original post

14 REPLIES 14

That's great!  It almost covers what I need in that it definitely closes the case when the last task is closed.

However, I don´t want this business rule to run for all HR Cases.  Only ones with certain HR services.  As the Business rule is based on the task table I can´t reference the HR service using the conditions (which I would prefer).

I know I could put it in the code itself in the if statement but am I missing an easier way to do this?

 

 

You can add a filter in Business Rule, which will certainly restrict this business rule to get triggered for other HR Cases.

At first you will be able to see the HR Task fields, scroll down select Show related field and you will see something like HR Cases ->HR Case fields select and now you will be able to select the HR Case fields in the filter, Select the desired field and value

Kindly Mark my answer as Correct and helpful based on the impact.

Regards,

Chaitanya

Thanks i looked for ti but didn´t see HR Case initially.  But I found it in Parent - HR Case - Hr Service.

Job done.  thanks again. 

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

Are this task created one after other or simultaneously and is there any workflow attached to it. I believe there will be.

Thanks,
Ashutosh

HI, Ah yes you are right.  The code above works however when I test with cases that have tasks arriving in series it sets the case into awaiting acceptance even though another task was created.

Is there a way around this that you know of?

(I´m doing it with service activities attached to a HR service BTW)