NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

def allCreateIncFiles = []
def allUpdateIncFiles = []
def sharedIncNumber = ""
def incidentCreated = false


if (!incidentCreated) {
def inpAddJSONCreate = '{"short_description":"rep_s_desc", "description":"rep_desc", "work_notes":"wrk_nts"}'
inpAddJSONCreate = inpAddJSONCreate.replaceAll("rep_s_desc", "Source File Missing")
inpAddJSONCreate = inpAddJSONCreate.replaceAll("rep_desc", """Hi Source Team {DL},
Could you please check and share the current status of the files mentioned in worklog? Also, request you to update the details in the incident for tracking and kindly provide an update when available, please do not close incident till EOD""")
inpAddJSONCreate = inpAddJSONCreate.replaceAll("wrk_nts", "Worklog should keep adding new files delay as it happens in same ticket")

//*
sharedIncNumber = INCnum.IncidentNumber.trim()
incidentCreated = true
}

allCreateIncFiles << [
FileName : FileName,
server : server,
DirectoryFolderPath: DirectoryFolderPath,
BufferedSLA : BufferedSLA,
Pipeline : Pipeline,
Job : Job
]

} else if (serverresult.outputStream[0] == "Update_Inc") {

def inc44 = serverresult.outputStream[1]

allUpdateIncFiles << [
FileName : FileName,
server : server,
DirectoryFolderPath: DirectoryFolderPath,
BufferedSLA : BufferedSLA,
Pipeline : Pipeline,
Job : Job,
incNumber : inc44
]
}

} else {
outputMap.outputStream = "Not enough elements in secondElement: $secondElement"
}
}

if (incidentCreated && allCreateIncFiles.size() > 0) {

def workNoteLines = new StringBuilder()
workNoteLines.append("Worklog should keep adding new files delay as it happens in same ticketnn")
workNoteLines.append("The following files have not been received and crossed the expected SLA as of ${currentDate2} ${currentTimeStr}:nn")
allCreateIncFiles.each { f ->
workNoteLines.append("File: ${f.FileName} | Server: ${f.server} | Path: ${f.DirectoryFolderPath}n")
}

def inpAddJSONUpdate = '{"work_notes":"wrk_nts"}'
def escapedNote = workNoteLines.toString().replaceAll('"', '\\"').replaceAll('n', '\\n')
inpAddJSONUpdate = inpAddJSONUpdate.replaceAll("wrk_nts", escapedNote)

//*

def emailRows = new StringBuilder()
allCreateIncFiles.each { f ->
emailRows.append("""<tr>
<td style="text-align:center">${f.server}</td>
<td>${f.DirectoryFolderPath}</td>
<td style="width:30px">${f.FileName}</td>
<td>${f.BufferedSLA}</td>
<td>${f.Pipeline}</td>
<td>${f.Job}</td>
</tr>""")
}

def EmailInc = "Hi Source Team {DL},<br><br> The below files have not been received and have crossed the expected SLA as of ${currentDate2} ${currentTimeStr}.<br><br>"
head = """<html><head><style>
table {font-family: arial, sans-serif; border-collapse: collapse; width: 100%;}
td, th {border: 1px solid black; text-align: left; padding: 8px; height: 40px;}
</style></head><body><table>
<tr><th>Server</th><th>Directory</th><th>FileName</th><th>BufferedSLA</th><th>Pipeline</th><th>Job</th></tr>"""

body = EmailInc + head + emailRows.toString() + """</table><br/><br/>
Could you please check and share the current status of the files? Also, request you to update the details in the incident for tracking and kindly provide an update when available, please do not close incident till EOD.<br/>
As the files are delayed, there is a possibility of impact on the given jobs. Kindly take necessary actions to prevent job failure.<br/>
<p>Regards,<br/>DNA File Monitoring Ignio Automation.<br/><br/>(It is an auto-generated mail. Please don't reply)</p></body></html>"""

mailsubject = "Source file SLA breach - SM"

iAction.Collaboration.SendMail(Body: body, Subject: mailsubject, To: toDNA, CC: CcDNA)
outputMap << [outputStream: "Create_Inc: Mail sent successfully to DNA team with ${allCreateIncFiles.size()} delayed files | INC: ${sharedIncNumber}"]
}

if (allUpdateIncFiles.size() > 0) {

def groupedByInc = allUpdateIncFiles.groupBy { it.incNumber }

groupedByInc.each { incNum, files ->
def updateNote = new StringBuilder()
files.each { f ->
updateNote.append("${f.FileName} has not been received and has crossed the expected SLA as of ${currentDate2} ${currentTimeStr}n")
}

def inpAddJSONUpd = '{"work_notes":"wrk_nts"}'
def escapedUpd = updateNote.toString().replaceAll('"', '\\"').replaceAll('n', '\\n')
inpAddJSONUpd = inpAddJSONUpd.replaceAll("wrk_nts", escapedUpd)

//*

def emailRowsUpd = new StringBuilder()
allUpdateIncFiles.each { f ->
emailRowsUpd.append("""<tr>
<td style="text-align:center">${f.server}</td>
<td>${f.DirectoryFolderPath}</td>
<td style="width:30px">${f.FileName}</td>
<td>${f.BufferedSLA}</td>
<td>${f.Pipeline}</td>
<td>${f.Job}</td>
</tr>""")
}

def EmailInc2 = "Hi Team,<br><br> Please find below the details of the incidents updated for the SLA breach of the files on ${currentDate2} ${currentTimeStr}.<br><br>"
head = """<html><head><style>
table {font-family: arial, sans-serif; border-collapse: collapse; width: 100%;}
td, th {border: 1px solid black; text-align: left; padding: 8px; height: 40px;}
</style></head><body><table>
<tr><th>Server</th><th>Directory</th><th>FileName</th><th>BufferedSLA</th><th>Pipeline</th><th>Job</th></tr>"""

body = EmailInc2 + head + emailRowsUpd.toString() + """</table><br/><br/>
Could you please check and share the current status of the files? Also, request you to update the details in the incident for tracking and kindly provide an update when available, please do not close incident till EOD.<br/>
As the files are delayed, there is a possibility of impact on the given jobs. Kindly take necessary actions to prevent job failure.<br/>
<p>Regards,<br/>DNA File Monitoring Ignio Automation.<br/><br/>(It is an auto-generated mail. Please don't reply)</p></body></html>"""

mailsubject = "Source file SLA breach - SM"

iAction.Collaboration.SendMail(Body: body, Subject: mailsubject, To: toDNA, CC: CcDNA)
outputMap << [outputStream: "Update_Inc: Mail sent successfully to DNA team with ${allUpdateIncFiles.size()} delayed files"]
}
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.