Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ScriptRunner custom email doesn't show the message

Hi, 
I'm trying to send a custom email to the assignee\reporter, the email is being sent but it only shows the subject, not the message. 

I use the template that ScriptRunner suggest:

def fields = get('/rest/api/2/field')
.asObject(List)
.body as List<Map>

def customFieldId = fields.find { it.name == 'Category' }.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}"""

 

And I tried to modify the text but nothing works. What is wrong? How can I make the text appear in the email's body? 

 

1 answer

0 votes

Hi @inna grin 

I guess you are using the post function where the send email will use the Jira email templates.

What you can try is creating a listener and use the script here. You will also find this script in the examples. This script should let you send an email with custom subject and body. The mail will not be sent if the changes are made by the same person.

It is using the following REST end point also mentioned here.

POST /rest/api/3/issue/{issueIdOrKey}/notify

I hope it helps.

Ravi 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

109 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you