Email Notifications to users do not include ticket number

Answered

All our users enter tickets through email but the notifications that they receive do not include ticket numbers in the subjecy line. We would like to include that. How do we do it?

Thanks,

Sunil

4 comments
Comment actions Permalink
Official comment

Hi,

You need to modify the workflow rule 'Send notifications to all unregistered users' in 'Notify Multiple Unregistered Users' workflow: at the end of this script there is a `createSubject` function, where you can place whatever you want to be included in the notification subject: issue id, line "[YouTrack]" etc.

Comment actions Permalink

Sorry, but I'm not sure how this works.

For example, the Subject line of the FIRST message that the user receives when he/she submits a ticket through email, is set in the "Collect Emails from Reported Issue" rule in the workflow that you mentioned.

Please check line #38 - that is where it is set as follows, by me:

var message = {
              fromName: 'Symbiosis Help Desk', // set whichever name you prefer
              toEmails: lastMessageRelatedEmails.slice(0, 1),
              subject: '[Symbiosis Help Desk] New Issue created', // set a subject you like
              body: 'A new issue has been created in the Symbiosis Help Desk system. Updates will be sent to you as we work on this issue. Please REPLY TO THIS email with any further comments or updates on this issue. Please DO NOT open a separate ticket for the same issue. Opening a new ticket for the same issue will delay the resolution.' // set a full body of your notification
                    };
       notifications.sendEmail(message, issue);

And in that workflow, I cannot add "issue.id". So I cannot do:

subject: '[Symbiosis Help Desk] New Issue created', issue.id // set a subject you like

The "Notify Multiple Unregistered Users" rule seems to work for subsequent notifications and not for the very first, "Issue created" notification.

Am I misunderstanding this?

Thanks,

Sunil

0
Comment actions Permalink

Hi,

`issue.id` is just a string, so, to add it to the summary you just need to use the concatenation:

`subject: '[Symbiosis Help Desk] New Issue created: + issue.id`

Now, if you want to add notifications about new issues, you need to add some lines in "Collect Emails from Reported Issue", you are right. It will look like this:

issue.fields.lastEmails = null;

// add the following lines:
var message = {
fromName: 'YouTrack', // set whichever name you prefer
toEmails: lastMessageRelatedEmails.slice(0, 1),
subject: '[YouTrack] New Issue: ' + issue.id, // set a subject you like
body: 'The text of the notification' // set a full body of your notification
};
notifications.sendEmail(message, issue);
0
Comment actions Permalink

Thanks. This is all set.

0

Please sign in to leave a comment.