How do I stop "comments added" notification from firing on requests when the request is closed

curtisr
Kilo Expert

I have a scenario where end users are getting double emails when the last task to a request is closed with a user visible comment. The system is firing off one email for the comment and another for the request being closed complete. Odd thing, the close complete email has the comment from the previous email so it looks like a duplicate. Is there a way to prevent the comment notification from firing when the request is closed? I have tried every status field available in the condition builder to no avail. I am starting to think it will need to do an advanced script, but am not quite sure where to start since anything I can think of would reference the same fields in the condition builder.

I did try a search, but feel that I may be using the wrong criteria .

Thank you in advance!

1 ACCEPTED SOLUTION

curtisr
Kilo Expert

I figured it out! Had to use an advanced script, here is the code I used to stop the comment from firing when the request is closed.



if(current.request_item.request.active == 'true')


  {answer = true;}


else


  {answer = false;}



Seems so simple now that I see it . Thank you all for the input and help.


View solution in original post

6 REPLIES 6

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Curtis,



You can keep the condition for the notification which is fired for additional comment changes. I.e condition will be state is not closed complete


Thank you for the reply Pradeep,



I have tried the condition of "status | is not one of |" and selected all 4 of the possible closed status'. I also tried breaking it apart like the image below, but it is still firing the comment notification. Seems very strange to me, shouldn't this be working?



closed request.JPG


Hi Curtis,



I will take a look and get back to you in sometime.


The conditions are all in AND, you should make it Like


Additional comments changes


AND


status IS NOT close complete


        OR


        Status IS NOT closed Incomplete


        OR


                  And so on....


-Anurag