email notification for change request state changes

Mohanapriya1
Kilo Contributor

Hi,

When any change ticket state update happens then it should send notification to assignee and assignment group mail id.

So I am following the OOB "Change request state change notification" notification and given the script as below.

It is generating the notification for all the state changes but only for Authorize state change notification is not sent.

Please help on  this.

var cr = new ChangeRequest(current);
answer = (cr.changesToAssess() || cr.changesToAuthorize() || cr.changesToScheduled() || cr.changesToImplement() || cr.changesToReview() || cr.changesToClosed() || cr.changesToCanceled());

Thanks

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

Is the BR executed in authorised state? Because it seems the BR is not triggered.

Also this has to be done rightly in Notification. you dont need br for this.


Just create simple notification where condition is states changes and it will tirgger your notification.

Thanks,
Ashutosh

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

As per the OOB script it won't trigger when it changes to Authorized

This is the OOB script in the condition field

var cr = new ChangeRequest(current);
answer = (cr.changesToScheduled() || cr.changesToImplement() || cr.changesToReview() || cr.changesToCanceled());

it seems you have added the functin changesToAuthorize() to it

Seems that is what is not allowing the answer variable to be true

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Mohanapriya1
Kilo Contributor

Thanks for your assistance." simple notification where condition is states changes " is working now.