How to create Email notification previous priority and present priority for task

snow jagan
Tera Contributor

For Priority it should show if its raised or lowered depending on the previous task state.

for example:

SCTASK# followed by Task short description

“Priority raised to:” or “Priority lowered to:” followed by the Priority as shown above

15 REPLIES 15

shyamkumar VK
Kilo Patron

Hello Jagan , 

Please follow below Steps to Achieve your requirement 

1. Create Event in Event registry 

shyam10_0-1671730028277.png

2. Create Notification 

shyam10_1-1671730091592.png

3. Create email script - I have named sc_task_priority and called to email body - you can do the same

function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {

    // Add your code here
    template.print("The Priority of this Task has been changed from Priority:" + event.parm1 + " to Priority:" + current.priority);

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

 4. Create Business rule 

After - update BR 

gs.eventQueue("priority_change_in_sc_task", current, previous.priority, gs.getUserId());

 - paste above code in Advance section of the script

 

 If it helps please click Accept as Solution/hit the Thumb Icon if applicable

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Hello @snow jagan ,

have you tried my solution?

Revert if you need any assistance.

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

hey @shyamkumar VK 

it worked but i need to pass value of field but here I'm getting sys id how can we meet the exact requirement?

thank you

Hi Shyam,

As Weenie27 said this solution gives us the sys id for the old priority.