Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

JMWE Comment Issue Post Function

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

2 answers

2 accepted

1 vote
Answer accepted

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.

it doesn't seem to be generating the email that an @mention normally does or any notification

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.

Like John Funk likes this

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.

Like # people like this

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) :

Message:
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}}]

@subham patra can you share a screenshot of the post-function configuration?

HI @David Fischer _Appfire_  - PFB,

Case 1:

JMWE_Comment.JPG

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. 

JMWE_Comment3.JPG

@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. 

I have tried that as well. Now it's printing as a text.

JMWE_Comment4.JPG

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.

0 votes
Answer accepted
John Funk Community Leader Sep 02, 2020

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

243 views 7 7
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