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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,788
Community Members
 
Community Events
184
Community Groups

Finding Mentioning a User in Comment ... and Custom Field User Picker (multiple users) check

  • Finding the Mentioning of a User / s in last Comment

than add to...(Watcher...or a Custom Field...) adding leads to another question

 

  • Costum Field User Picker (multiple users) check difference

check if a user already got a mail, it is used for group works since its a custom field user wont get notified. i managed to inform them via comment or email spam everytime the value of picker changes.

But it would be much better if i could just sent a message to the last person/s added an email and avoid duplicates.

Iam not sure how i can split the picker and check for values.

 

1 answer

1 accepted

1 vote
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.
May 21, 2023

Hi @Christoph Schulz 

Your scenario seems to be: when someone is mentioned in a comment the first time, I want to add them as a Watcher (or to a Custom Field), and send them an email.  When the user is mention again later I do not want to add them to the field again or send another email.

Does that sound correct?

For a question like this, I recommend posting images of your complete current rule and the audit log details showing the rule execution.  Those will provide context for the community to offer suggestions.

Without that information...

It appears you have already learned how to find and extract and account ID value from a comment mention.  If you pull out all possible mentions from the last comment, your rule could use an advanced branch to iterate over them.  Then use an advanced compare condition to determine if they are already listed as a Watcher (or in the Custom Field), and only proceed if they do not exist yet in the field.

Kind regards,
Bill

Almost yes,

iam struggling at this part "how to find and extract and account ID value from a comment mention."

So my Automation would start like Task commented, find the mentioning, than use the account ID for an email or add as a watcher.
(Task commented > compare {{issue.comments.last.body}} has [~accountid:  )

 

The custom field, i have trouble with the many account IDs it saves. So when an Automation starts i have all the accounts, and i will send them all an email even if they were before inside of the custom field. 

Yes an advanced compare, to figure out the difference between the newest vaule of the field and the last in a log i guess. I want to subtract the accounts which are doubled to get the unique ones and sent them a mail to inform them, you are on the task. 

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.
May 23, 2023

Let's try this one piece by piece...

First, mentions in comments store only the account ID for a user.  To find all of the users mentioned in the last comment, the expression below works.  It would split a comment into lines, find mentions, and then extract the account id values.

{{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}}

That can produce a list of the users, and so they must be iterated over in an advanced branch.

For your scenario, you only want to email the users who are not already watching the issue...and so they must be tested, one by one.  And so an example rule would be:

  • trigger: issue commented
  • action: 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: leave as empty
  • advanced branch:
    • smart value:{{varAddWatcher.split(",")}}
    • variable name: varWatcher
      • advanced compare condition:
        • first value: {{issue.watchers}}
        • condition: does not contain
        • second value: {{varWatcher}}
      • action: add watcher, {{varWatcher}}
Like Christoph Schulz likes this

Exactly this 🙌

Perfect!

Thank you for the lesson and continue to support.

.

Like Bill Sheboy 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.
May 24, 2023

Awesome!  I am glad to learn that helped, and also...

Using automation rules often requires both experimentation and learning.  To help with those I recommend building skills by:

  • look at the examples in the template library to learn how they solved problems
  • look at posts/examples in the community to see if others have already solved a problem you are trying to address...this can be tricky, as people describe things differently, so I recommend using a web search to find the posts in the community :^)
  • create a test project (at least) or a free Jira instance (at better) to experiment and "break things" while trying out rules.
  • regularly go look at the documentation pages, as they continue to improve over time
  • think outside the box: often rules cannot solve a "problem" and pausing to consider why something is needed may reveal a better solution

Happy experimenting!

Like Christoph Schulz likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events