ScriptRunner Cloud > Post Functions > Send Notification: Dynamic subject?

James N. December 20, 2018

I tried putting this in the subject field:

${issue.id}: ${issue.summary}

But it just uses this exact text instead of replacing it with the issue ID and summary. Is there a way to get details from the issue into the Subject line of the email?

1 answer

1 accepted

1 vote
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 21, 2018

Hi James,

Thank you for your question.

I can confirm that you can override the notification map which is sent to the notification API  as described when clicking the Show More link above the additional actions code bo which links to the API documentation here.

I have created an example of the line you should add to override the notification specified inside of the subject box which you can view here and you can use this example code to show how to dynamically set the subject for a notification based on values from issue fields.

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,

Kristian

James N. December 21, 2018

Thanks!

The following worked perfectly in the Additional Code section:

notification.subject = "${issue.key}: ${issue.fields.summary}"

 

zoran Krstic March 10, 2019

if you kann Germany laengwige wier use komunicescen

Suggest an answer

Log in or Sign up to answer