Get Started with Redwood for Oracle Cloud HCM Begin Now
Groovy script for notification when SR is ORA_SVC_CLOSED
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) {
Tagged:
0