The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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 _Appfire_ - 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.
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 _Appfire_ - 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.
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 there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.