Creating a flow that updates the State when a user comments on their INC via the Service Portal?

cdavis22
Tera Contributor

Hi, 

 

I am not sure how to move forward with creating this flow that changes the state when the additional comments are updated via the service portal. I currently have a BR that works most of the time but a few seem to slip through so I was hoping a flow would be the answer to my problem but I am stuck at a standstill. 

 

I'm assuming that I need to create a flow action & add it to the main flow????....... but I am not sure what the inputs should be since my instance does not have a "reference type" & it is also not giving me the option to select "updated by caller" in the regular flow. I figured I could create a flow simply by checking if a user updated the additional comments of their assigned ticket via the service portal (not by replying via email) & the incident state will change to choice #9 = Follow up but it is not that simple for me (or I'm overcomplicating things). Hoping for some assistance! 

 

Flow:

cdavis22_0-1702484857577.pngcdavis22_1-1702484909709.png

 

cdavis22_2-1702484956637.png

cdavis22_3-1702484991113.png

 

BR: This works but some incidents seem to slip through the cracks.

cdavis22_4-1702485123131.png

Advanced:

(function executeRule(current, previous /*null when async*/) {

   // Check if there's a new comment added by the caller
   if (current.comments.changes() && current.sys_updated_by == current.caller_id.user_name) {
      current.state = 9;  // Follow Up.
     
      current.update();  // This saves the changes made to the 'current' record
   }

})(current, previous);

 

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @cdavis22 

instead of choosing another tool, you should invest more time to find out why your business rule is not working sometimes.

Maik

Hi!!

 

Well this is actually the second time this has happened so that's why I'm considering a flow possibly but I agree.