0
0
Jenkinsdevops~10 mins

Email notification plugin in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the recipient email address in Jenkins email notification.

Jenkins
emailext(
  to: '[1]',
  subject: 'Build Notification',
  body: 'The build has completed.'
)
Drag options to blanks, or click blank then click option'
Abuild@company.com
Badmin@example.com
Cnotify@domain.com
Duser@jenkins.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid email format
Leaving the recipient field empty
2fill in blank
medium

Complete the code to set the email subject line in Jenkins email notification.

Jenkins
emailext(
  to: 'build@company.com',
  subject: '[1]',
  body: 'Build completed successfully.'
)
Drag options to blanks, or click blank then click option'
A'Build Notification'
B'Build Status'
C'Build Complete'
D'Notification Email'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the subject string
Using an unrelated subject line
3fill in blank
hard

Fix the error in the Jenkins email notification code by completing the missing field.

Jenkins
emailext(
  to: 'build@company.com',
  subject: 'Build Notification',
  body: [1]
)
Drag options to blanks, or click blank then click option'
AThe build has failed.
B'The build has failed.'
Cbuild_failed
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the body text
Using undefined variables instead of strings
4fill in blank
hard

Fill both blanks to add a reply-to address and set the email content type in Jenkins email notification.

Jenkins
emailext(
  to: 'build@company.com',
  replyTo: '[1]',
  contentType: '[2]',
  subject: 'Build Notification',
  body: 'Build completed.'
)
Drag options to blanks, or click blank then click option'
Anoreply@company.com
Btext/plain
Ctext/html
Dsupport@company.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid email format for replyTo
Setting contentType to unsupported values
5fill in blank
hard

Fill all three blanks to configure a Jenkins email notification with recipient, subject, and body using variables.

Jenkins
def recipient = 'devteam@company.com'
def subjectLine = 'Build [1]'
def messageBody = 'The build number [2] has [3].'

emailext(
  to: recipient,
  subject: subjectLine,
  body: messageBody
)
Drag options to blanks, or click blank then click option'
AStatus
B#42
Csucceeded
Dfailed
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up build status words
Not using variables correctly in strings