Business Rule help - update incident state when commented

Travers M
Mega Guru

I am currently trying to make it so when a user adds a comment to their incident in self serve view that it will update the incident state.   I have an incident state that is custom (10) and it's need more information.   When the user replies to email, I have that working fine and changes it to the work in progress (2) but I can't seem to get this to work when it comes to commenting through the self serve portal as it seems users do not have write access to the state field.   If that's the case, why does it work in one area and not the other?   My business rule I have in place (but doesn't work) is a "before" and "Update":

 

Condition:     current.state == '10' && current.comments.changes() && gs.getUserID() == current.caller_id

 

Script is:  

 

current.state == 2;

current.update();

 

Anyone see something that jumps out that them as being incorrect?

1 ACCEPTED SOLUTION

So I did get a solution from HI, it wasn't a conflict at all but an issue with the syntax.   Here is the answer from HI:



I'll help you resolve this issue.   Please change line 1 of the Business Rule "State to WIP if Requester Adds Comments"


from


current.state == 2


to


current.state = 2;



'Double equal signs' test for equality and a 'single equal sign' is used to assign a value.


View solution in original post

8 REPLIES 8

That's a client script. It won't run unless in a browser, so, no.


Yeah, I got nothing.   It should work, and it does in a demo instance.   I'd open a ticket with HI and get their opinion.


I thank you for your help.   To HI I go.


So I did get a solution from HI, it wasn't a conflict at all but an issue with the syntax.   Here is the answer from HI:



I'll help you resolve this issue.   Please change line 1 of the Business Rule "State to WIP if Requester Adds Comments"


from


current.state == 2


to


current.state = 2;



'Double equal signs' test for equality and a 'single equal sign' is used to assign a value.