How can you add a new line within this example? Regardless of how I do this, the email is sent with everything on the same line.
def fields = get('/rest/api/2/field')
.asObject(List)
.body as List<Map>
def customFieldId = fields.find { it.name == 'TextFieldB' }.id as String
def customFieldValue = (issue.fields[customFieldId] as Map)?.value
"""Dear ${issue.fields.assignee?.displayName},
The ${issue.fields.issuetype.name} ${issue.key} with priority ${issue.fields.priority?.name} has been assigned to you.
Description: ${issue.fields.description}
Custom field value: ${customFieldValue}
Regards,
${issue.fields.reporter?.displayName}"""
Perhaps you have Email format set to HTML, in which case you need <br> or <p> tags to cause linefeeds, e.g.
<p>Dear ${issue.fields.assignee?.displayName},</p>
<p>The ${issue.fields.issuetype.name} ${issue.key} with priority ${issue.fields.priority?.name} has been assigned to you.</p>
Either do that or switch from HTML mode to Plain Text mode.
Thanks, I figured this might have something to do with it, but the script console made it look like the tags would be included as literal strings in the return.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.