Hi Jira Community,
Looking for some help using the native automation tools in Jira Cloud to create automation where if a user is mentioned/tagged in the comments section, they'll be added as a watcher for future issue updates. My thought process here is that if a user is tagged, it's likely they are then impacted or associated with the issue and may want updates on that particular issue. Do I need to add a specific JQL condition after "Comment is the main action" rule trigger? Any help would be greatly appreciated!
Hi @Mateus Almeida -- Welcome to the Atlassian Community!
Until such a feature is built into Jira Cloud, what you can try is creating an automation rule, triggered on Issue Commented, extract the mentioned users' accountId values, and then add them as watchers. To do this, you will need...
{{issue.comments.last.body.split(" ").match("(accountId:.*)]").remove("accountId:")}}
Kind regards,
Bill
UPDATED: Another community member noted my rule did not handle multiple mentions on the same text line, and so I revised this one to first split on spaces before searching for the mention-markup information.
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 the above which hasn't worked, note that the project is using issue security
Trying to add @mention and then add this to the watcher as to selecting a user.
The SL has a watcher
Here's the rule
When: Issue commented Comment Type: Comment on the main action Then: Create variable Variable name: varAddWatcher Smart Value: {{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}} Advanced compare condition: First value: varAddWatcher Condition: does not equal Second Value: empty Then: add Watcher {{varAddWatcher}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Test work
Please review the suggested solution as you appear to be missing the part to use an advanced branch to iterate over the values.
As an alternative, I believe you may also try adding them in one step using advanced edit with JSON.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See the screen shot enclosed which i have used condition and Advanced Branching.
The other issue is the watcher- If I mention a person , that person should be added into the watcher field, the option of action doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you see the red exclamation mark in your action to Add Watchers? There is something wrong with that action. Please review that to find the problem, and if you are unable to find it, post an image of your Add Watcher action so the community can try to help.
Based upon your rule, you should be using the Variable Name defined in the advanced branch: {{WhatSmartvaluesshouldbeused}}
And remember that smart values are name, spacing, and case-sensitive. So it must exactly match your defined variable name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get the red exclamation mark as I left that blank - however I don't want to insert a name.
If I @ mention in the comment, then that name should be added to the watcher
See the additional screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To use that action, you must enter something.
The original question for this thread was to add watchers based on mentions in the comments. And all of the rule logic suggested up to this point was so the smart value can be entered in the Add Watcher action.
If you now want something else, I suggest creating a new question, with a new post, and clearly describe what you are trying to accomplish. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mateus Almeida - are you using server or cloud? If you are using server, this feature has been enabled where @mentions on comments make the mentioned user a watcher. In cloud, there is a suggestion open in the Jira Cloud project that is in the "Reviewing" status. See here: https://jira.atlassian.com/browse/JRACLOUD-31869. I voted for this feature for you.
At this point in cloud, @mentions are used to just reach out to someone once. Here is some more information: https://www.atlassian.com/blog/jira-software/using-watchers-and-mentions-effectively
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.
Dear @Summer Hogan
We are using server data center version of Jira, but we are unable to add @mentioned user to watchers list automatically.
Is there anything that we need to enable in order for this feature to work?
Or the script id the only option for server too?
Any help would be highly appreciated.
Kind Regards,
Pooja
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.