I want to notify the reporter of an issue that they forgot to complete or fill in a field, e.g. Build ID, Environment, etc.
I am open to other post functions, however, my question here is can I create a comment that sends an email to the reporter using the following format in the comment?
@username comment
how do I construct that "@username" in nunjucks?
I have tried using the Display message Post Function but that only works in View issue mode so the reporter won't always see it
I have tried Email User post function but that won't send to the user doing the transition
Adding an @mention in the comment is actually possible using the following code:
[~accountid:{{issue.fields.reporter._accountId}}]
which is the "wiki markup" syntax for @mentions.
However, note that mentions are currently broken on the "old" issue view - they won't display properly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry, I didn't think about that, but of course @mentions follow the same rule as any other Jira notification: Jira won't send notification emails to the author of the change, unless the recipient has opted to receive such "self-notifications" in their Preferences.
The workaround is to use the "run as" option of the post-function to create the comment as the "add-on user" (or another fixed user), so that it is never the same as the current user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And by the way, to answer the last line of your initial question, the same "trick" applies to the Email Issue post-function - if you use the "run as add-on user" option, the email will go out to the Reporter even when they're the current user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a similar requirement to mention user in comments from a single user picker custom field. I am using JMWE "Comment issue post-function". Should this work for custom field as well? We are on DC!
However getting below error using the same code (for reporter) :
Compilation error(s): script_ffca1a040c2bdd640f280424f6ac324b.groovy: 1: illegal colon after argument expression; solution: a complex label expression before a colon must be parenthesized @ line 1, column 12. [~accountid:{{issue.fields.reporter._accountId}}]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @David Fischer - PFB,
Case 1:
Case 2: Here "Employee Name" is a user picker field. In the comment the username is printing as a plain text, hence jira notification is not being sent to the mentioned user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@subham patra that's because, i the first post function, you selected Groovy Expression as the comment type. Change it to Text or Groovy Template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried that as well. Now it's printing as a text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's the Cloud syntax. The Server syntax is the one you used in the other post-function. For a user mention, it'll be:
[~${issue.get("reporter").name}]
or
[~<%=issue.get("reporter").name%>]
which are synonymous.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer - your suggested syntax applies to the "reporter"
[~accountid:{{issue.fields.reporter._accountId}}]
What's the syntax for @mentioning users not on the issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ron Chan ,
what do you mean by "users not on the issue"? Explicit (fixed) users? In that case, you'd need to get their accountId (with JMWE, you can use the "Lookup user..." button on the Nunjucks editor toolbar) and insert it:
[~accountid:124342435:2342334234:23423423]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer Can you post the expression for Cloud?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.
Register nowOnline 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.