Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How send email to user mentioned in comment

There is a problem.

 

I want to make rule, thet if somebody mention user in comment, this user get email with custom message.

I can take accountid from comment. But I cant take email from that accountid. It looks like a plain text.

 

Is there any abilities to get user email from accountid in rule?

Thanks/

3 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 22, 2022

Hi @Семён Жарычев -- Welcome to the Atlassian Community!

You could call the REST API with a web request using the accountId, get the email address, and then send your custom message.  Please note doing this means the user would get 2 emails per mention: one from the mention and one from the rule.

If you want to try this approach, here are some references to help you get started:

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/user-getUser

 

Kind regards,
Bill

It's awesome. Thanks a lot.

It works!!!

Like # people like this

I try this/ And for me it works well. But for other users (if in cimment mentioned not me) webhook is succesful, it can take user name, but cant take user email adress.

What could be the problem?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 28, 2022

Please check the response from the web request to determine if it was successful.  If so, try writing the response to the audit log to learn if the email address was successfully found for the user's account ID.

@Семён Жарычев Could you show me how your's automation working? I have the same problem about mentios in automations and i can't resolve this properly.

@Szymon Cichocki 

LastUserCommented is a custom field with userpicker, that hidden in issue screen (both create and edit/view)

Like Szymon Cichocki likes this
Like Szymon Cichocki likes this

Thank you very much for help!

@Семён Жарычев I am following your steps, however I am not sure about the variable creation.

How did you create the "LastUserCommented" field to show in the dropdown?

My variable does not appear in the "choose fields to set" dropdown.

I am new to Automation so if you can attach a picture of how you created the variable and what you did to show in the dropdown.

All the other fields are working fine but I am not able to extract the mentioned user's email address. 

{{issue.comments.last.body.substringBetween("accountid:","]")}} this returns the account id but I am not aware how to get the email from this.

Thanks in advance.

cc: @Szymon Cichocki @Bill Sheboy 

Like ABDESSAMAD JARIR likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Sep 29, 2022

Hi @Yaseer Jawhar 

If you only have the accountId value, you would need to call a REST API function from the rule (with a web request) to get the email address, or other user information.  That is described at the beginning of this thread.

Kind regards,
Bill

Hi @Bill Sheboy
Thank you for the details. 
I will try that solution as well.
The solution proposed by @Семён Жарычев and @Szymon Cichocki worked for me at the moment.

Like Bill Sheboy likes this

Hello @Yaseer Jawhar ,

Did you find a solution to extract email address from mentioned user, i am blocked in this point?.

Thank you very much

Yes @ABDESSAMAD JARIR I got it sorted.
The solution adds a label to the existing 

atlassian.png

Thnaks @Yaseer Jawhar ,

I already fixed it in otherway, for me, i just change a type of created costum field .

@ABDESSAMAD JARIR  Great!.
If you can post your solution here, it might help the others who come.. Cheers!

@Yaseer Jawhar  of course, i have just change type of my costum field to user picker (in costums fields configurations)

Capture.JPG

I have only Polish version of system so i dont think my screenshots can help you.

But here you got video : https://www.youtube.com/watch?v=L1Kv3xA0TM0

And here tutorial : https://support.atlassian.com/jira-cloud-administration/docs/create-a-custom-field/

@Szymon Cichocki Thank you. Much appreciated..

Hi,

 

you have to create new custom field with a name "LastUserCommented" an type "user pick".

Remember to add this field to your issue screens.

Hi @Eszy 

Thank you for your response, is it possible for you to post some screenshots on how to add it, it will be very helpful.

I appreciate your time.

@Szymon Cichocki I configured this. Thanks for your help.. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events