Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Priority Change notification.

Renu4
Tera Contributor

Hello All,

i am working on sending the email notification when the priority of an ticket is changes.

i refered to the thread here:

https://www.servicenow.com/community/itsm-forum/how-to-create-email-notification-previous-priority-a...

this works fine but it gives me thw sys id instead of the priority 

Renu4_0-1699619780228.png

 

7 REPLIES 7

AnveshKumar M
Tera Sage
Tera Sage

Hi @Renu4 

 

Can you share your mail script and Business Rule Script screenshots here?

 

Meanwhile you can try the following script in your Business Rule.

 

(function executeRule(current, previous /*null when async*/) {
   var prev_priority = previous.getValue("priority") + '';
   gs.eventQueue("priority_change_in_sc_task", current, prev_priority, gs.getUserId());
})(current, previous);

 

Please mark my answer helpful and accept as solution if it helped 👍✔️

Thanks,
Anvesh

Hello Anvesh,

Please find the screen shots business rule attached here.

(function runMailScript(current, template, email, email_action, event)  {
    template.print("The Priority of this Task has been changed from Priority:" + event.parm1 + " to Priority:" + current.priority);

})(current, template, email, email_action, event);

 

i tried what you suggested also @Anvesh Kumar but nothing seems to be working .

is there a different way of doing this?

Clara Lemos
Mega Sage

Hi @Renu4 ,

 

Are you testing out by really firing the notification (Preview Email) or by previewing the notification ( in the notification record , 'Notification Preview')?

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers