Set closed date to current date when state changes to closed

Pete Beesley
Mega Contributor

This should be fairly simple but I can't for the life of me figure it out.

We have a few custom applications with closed fields as well as closed state but unlike incidents the closed date doesn't get automatically populated when the state is changed. This is also happening on the change form when the team bypass the work flow and directly update the state.

1 ACCEPTED SOLUTION

mark_closed is the business rule on incident that sets it.   Take a look at that.


View solution in original post

4 REPLIES 4

Mike Allen
Mega Sage

A before update business rule with condition current.closed.changesTo(<value of closed state>)



if (current.closed_at.nil())


  current.closed_at = gs.nowDateTime();


mark_closed is the business rule on incident that sets it.   Take a look at that.


Mike, this suggestion was perfect, just had to change the table and the condition and then Insert and Stay a few times



Thanks


Any reason why this wouldn't work in Eureka, worked perfectly in our dev environment running Fuji but the exact same rule doesn't do a thing in Prod