Customized HR Case Flow

bmorss
Kilo Contributor

I am currently trying to set up a customized state flow for specific HR Cases regarding ServiceNow changes. We want to have different phases (request review, business requirements, functional requirements, etc.) in which at each phase the assigned to user can set the state to "Review" when they think it is complete and reviewers can move it back to the previous phase if it needs more work or approves the work and moves it forward to the next phase.

We are currently working with Helsinki and are not using workflows at this time. Is this going to be very complicated to set up using state flows? Or is there an easier way to accomplish this that doesn't involve adding a bunch of new State choices and State Flows?

1 ACCEPTED SOLUTION

The second parameter is the sys_id of the state flow record. (I know, I hate sys_ids in scripts too!)



I have attached a cheat sheet that is meant to augment the product documentation on state flows. I hope you find it helpful. Please let me know if there is any feedback.



Thank you


View solution in original post

13 REPLIES 13

Mike Allen
Mega Sage

The way we did it without workflow is to make state read-only, then expose UI Actions that allow people to move states.   One UI ACtion could be:



current.state = 5; // or whatever your state field value for resolved is


current.update();



and then the other buttons can be 'return to whoever' and 'accept solution', one which takes the state back to the WIP state, and the other which closes it.



Then, just put the conditions for the button to be available as something like:



current.assigned_to == gs.getUserID() && current.state == [some WIP state number]



And the buttons that either accept or reject the solution will have conditions like:



current.assigned_to == gs.getUserID() && current.state == [your review state number]


I encourage you to take a look at State Flows as well. They can help you manage your UI actions without quite as much scripting.


I think I will probably end up going with state flows. I'm looking into UI Actions to prompt manual transitions and I am confused about one thing. I looking an existing UI Action called Accept Completion and I am unsure of the script section. It looks like this:



new global.StateFlow().processFlow(current, 'f97738929f3131001b991471367fcfda', 'manual');



I assume this is to initiate one the the existing case state flows but I am not sure what the second parameter is and where I would find that value for my own customized UI actions.


The second parameter is the sys_id of the state flow record. (I know, I hate sys_ids in scripts too!)



I have attached a cheat sheet that is meant to augment the product documentation on state flows. I hope you find it helpful. Please let me know if there is any feedback.



Thank you