Automation for Auto Assign and Mention in the Comments

Madison Brooks July 28, 2022

Hello!

I am trying to create an automation, I have had so much trouble with this task though.

Want:

when an incoming ticket is created that needs review - assign a person from a list AND mention them in the comments.

What I have tried:

Automation - When: Issue Created, If: Issue Matches JQL, Then: Assign the issue to, And: Comment, And: Send Email - Assignee

Issue - 

Send email
There is no value set for the field:
assignee
Could not send email, the 'To' address field is empty. If you have referenced a field it may be empty.

 

SO then I made a second

automation - When: Issue assigned, If: Issue matches JQL, Then: Add Comment to Issue, And: Send email - Assignee

Issue - 

only gets triggered when a user manually changes the Assignee.... not when the automation does it - which is what I was trying to solve for.


With multiple attempts & research, I am stuck on what I thought would be a simple problem. 

Please help!

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2022

Hi @Madison Brooks and welcome to the community!

This is totally, possible, but I have to ask why there is a need to go through all three mechanisms of notification?  Provided the notification scheme is set up for default behavior:

  • Assigning the issue will send the assignee an email
  • Commenting with an @mention will send an email
  • Send Email function will obviously send an email

This means that every time the team member is assigned an issue they will get at least three emails (not counting any subscriptions they may have set up for themselves).

Madison Brooks July 28, 2022

THANK YOU!

The email was mostly just for testing why my comment was not working, my real goal is to have the user mentioned in a comment on the ticket so that they receive a jira notification (our team only works on @ mentions).

 

How can I get the assignee to not be null (as seen by my email error) so that I can use it to be mentioned in a comment on the ticket?

Madison Brooks July 28, 2022

Nevermind, 

I think found the answer to my question elsewhere.

I believe I needed the re-fetch issue data action? Then the assignee will be populated and I can use it to @ mention them in my comments.

image (31).png

Quick suggestion, next time could you please also provide the solution while also asking your question? Saying it "This is totally, possible, but" was not a useful solution to my issue.

If you have other solutions please share as I am excited to learn more about Jira!

Thanks!

Like # people like this
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2022

Sorry got called away after your response.  I didn't have an exact solution on my first answer until I had additional context in your second and by the time I got back to this, you had found a solution on your own.

You are correct that this is a good scenario for the re-fetch action.  If the rule sets the assignee then attempts to take action on that assignment, the rule may still be working under the initial fetch where the assignee was empty so the re-fetch helps recalibrate midstream.

I'm glad you were able to find a solution and hopefully you understand how our wires got crossed between comments... I don't typically "lecture and run" as a practice. 🙂

Like Madison Brooks likes this
Ariela Orian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2023

Hi
I have an automation that is adding a comment  with mention.

I'm using [~accountid:{{issue.assignee.accountId}}]

for the mention, 

But what I get in the comment is [~accountid:ariela]

and no email is sent as a result of the mention....

Any idea what I'm doing wrong?

The action on my automation is:

automation_comment.jpg

and the resulting comment on the issue is:
issue_comment.jpg

and no email is sent :(

Will appreciate any help ....

Thanks

Ariela

Ariela Orian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2023

RESOLVED

This notation in the automation comment works -

[~:{{issue.assignee.accountId}}]

It interprets to the user mention in the issue, and email is sent as expected

Thanks

Arif September 4, 2024

it didn't work on me :(.

the comment result is like this :

 Hi [~:JIRAUSER17615]

even though I have followed the same notation:

Hi [~:{{issue.assignee.accountId}}]

 

I am using Jira Data Center, is it the cause?

Arif September 4, 2024

Update:

it's solved in JIRA DC by using this notation:

Hi [~{{issue.assignee.name}}]

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events