Groovy script for notification when SR is ORA_SVC_CLOSED — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Groovy script for notification when SR is ORA_SVC_CLOSED

edited Jul 4, 2024 9:14AM in Help Desk 2 comments

Summary:

Hello, I need to send a notification when an SR move from status Resolved to Closed,

I try to write a groovy with bot triggers Before update and Before insert and enable the Notification preferences

if (isAttributeChanged('StatusCd')&& StatusCd == 'ORA_SVC_HRHD_CLOSED') {
try {
def recipientPartyId = PrimaryContactPartyId
def messageText = 'BLA BLA BLA.'

    if (recipientPartyId) {
def map = new HashMap();
map.put("Channels", ["ORA_SVC_EMAIL", "ORA_SVC_BELL"]);
map.put("MessageText", messageText);
map.put("ObjectCode", "HRHelpDeskRequestVO");
map.put("ObjectId", srId);
map.put("RecipientPartyId", recipientPartyId);
adf.util.sendNotification(adf, map)

} else {
println("No Assignee associated with this SR")
}
} catch (e) {

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!