than add to...(Watcher...or a Custom Field...) adding leads to another question
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please post images of your complete current rule, and show the details of your branch and advanced compare condition, and of the audit log details showing the rule execution? Those may provide more context for making suggestions. Thanks!
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.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exactly this 🙌
Perfect!
Thank you for the lesson and continue to support.
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Happy experimenting!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This automation rule works like a charm - the only downside is that even if no new mentions are made, the rule runs as a 'success' with message:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The lowest amount of rule runs would be trigger manualy.
or via Date/Time event window.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, only way around is if it strictly matches a JQL query condition however not sure you can target all users for comment/description field. CurrentUser() exists but not a catchall parameter for all other mentioned users to use in a JQL query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy thanks for the suggestions above! I tried to use the approach you suggested to help us with projects that have issue-level security.
We set the issue-level security to Assignee and Contributor(s) because there are sensitive projects where only a selected few should see all issues. For ease of use, I wanted to implement an automation that adds people as contributors once they are mentioned in a comment or the description.
I was able to use the suggestion for comments, but when multiple users are mentioned in the same comment, only one of them gets added, and the existing contributors are overwritten (which is problemativ because they lose view and edit rights for the issue).
Do you have any suggestions on how to adjust the automation rule so that all mentioned users in a comment (and ideally also in the description) get added, while the previously set contributors remain untouched?
Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As this is an older thread, I recommend creating a new question with "Ask a question" and including a link back to this one. That will ensure the maximum number of people see it to offer suggestions. Otherwise, only people following the older thread will see it.
Until we see your new question...
It appears you are directly editing the Contributor(s) field from the dropdown selection, and thus that will overwrite the values repeatedly, in no predictable ordering due to the way branches work. Instead of using the dropdown, you may try...
Use a single edit with a JSON expression and remove the branching: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field
For example, and assuming varAddBeitragende contains the list of distinct accountId values with the assignee's and other relevant users removed and that you have substituted in your custom field ID for customfield_12345:
{
"update": {
"customfield_12345": [
{{#varAddBeitragende.split(",").trim}}
{
"add": {"id":"{{.}}"}
} {{^last}}, {{/}}
{{/}}
]
}
}
That works by splitting the variable into a list, trimming any stray spaces, iterating over the values, and including an "add" for each one, with a conditional comma separating the values.
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.
Before Iam totaly stuck .. is there an easy way to get Email changed in a custom Field ? otherwise would i have to add @ domain and remove, replace everything around the display name ? But i will run into display name is not the full name in mail problems..
My tries are
1 {{addedfieldChange.valueIds}} id numbers
11 {{addedfieldChange.valueIds.emailAddress}}
2 {{addedfieldChange.emailAddress}}
3 {{addedfieldChange.values}} display names
33 {{addedfieldChange.values.emailAddress}}
4 {{fieldChange.to}} [list of id numbers]
44 {{fieldChange.toemailAddress}}
444 {{fieldChange.to.emailAddress}}
5 {{fieldChange.fromemailAddress}}
8 {{changelog.customfield_10034}} only custom field name worked
88 {{changelog.customfield_10034.emailAddress}}
9 {{customfield_10034}}
99 {{customfield_10034.emailAddress}} this worked but it gives me old and new
9999 {{customfield_10034.last.emailAddress}} just last email
99999 {{customfield_10034.addedfieldChange.to.emailAddress}}
999999 99999 {{customfield_10034.addedfieldChange.emailAddress}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recommend starting with the changelog to learn what is available for your field. Remember changelog will only include the fields which changed during an edit, and perhaps not other cases.
{{#changelog.yourCustomField}}{{fromString}}{{/}}
And the current value should be in the {{toString}}
Regarding the differences between the email address, displayName, and full name, you may not have access to that unless you are using a Jira user field (with an accoundId).
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.
Hello @[deleted]
It's a User Picker (multiple users) called Mitwirkende Personen
I would like to sent an email to Omar Darboe in this example
thats the changelog written in the task
Christoph Schulz hat Folgendes aktualisiert: Mitwirkende Personen 28. Juni 2023 um 15:15 [Chat Notifications, Jie Yan Song]----[Chat Notifications, Jie Yan Song, Omar Darboe]
{{changelog.Mitwirkende Personen}}
ChangeItemBean{fieldId='customfield_10034', field='Mitwirkende Personen',fieldType='null',from='[5b70c8b80fd0ac05d389f5e9, qm:b81e873f-658f-47e0-b05b-48fec4419b59:75b1855b-71eb-4000-93f4-b0f1f081015d]',fromString='[Chat Notifications, Jie Yan Song]',to='[5b70c8b80fd0ac05d389f5e9, qm:b81e873f-658f-47e0-b05b-48fec4419b59:75b1855b-71eb-4000-93f4-b0f1f081015d, qm:b81e873f-658f-47e0-b05b-48fec4419b59:a1654234-e66e-4113-82ba-0ff38c8b6400]',toString='[Chat Notifications, Jie Yan Song, Omar Darboe]'}
{{#changelog.Mitwirkende Personen}}{{fromString}}{{/}}
[Chat Notifications, Jie Yan Song] {{toString}}
{{addedfieldChange.valueIds}} qm:b81e873f-658f-47e0-b05b-48fec4419b59:a1654234-e66e-4113-82ba-0ff38c8b6400
{{addedfieldChange.values}} Omar Darboe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can i set up a tempory or hidden user field in background that fills in only the changed value and sent an email to them ? and after that its done it will clear the data again... shouldnt be this the easiest way ?
it will have the ids, no need to edit anything. the only thing is i need to take care of is that nobody would touch that field.
like a cache
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use an entity property for that; rules can set/read them and they would not be on the screen.
Would you explain further: why do you need to save the value when you want to notify the changed users each time?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Email only accepts people fields, if i use it on all Mitwirkende Personen it would result in spam to people who were inside the Field before.
i've tried sent the mail to {{addedfieldChange.valueIds}} but it said its empty so.. i guess it's the only way to save it, is in a new field ?
""You could use an entity property for that; rules can set/read them and they would not be on the screen."" Not sure how this works ive tried use my account as property for the key and the value but it can't the mail to the {{key}} because its empty 🤷♂️
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry didn't read why, the custom field has no notification by default (like assign) the people get added and the project leader would have to write a comment or sent a group mail to inform them.
That's too complicated.. so i try to automate an easier way, also that other people can understand what i did.. if iam out of office and have to troubleshoot it.
Not sure if the Team Field will get notification soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But sometimes there are random people from 2 teams so it probably has to be a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
custom requests like this are difficult @Bill Sheboy .. maybe i need to convince them its easier to use watchers since its an integrated feature and could sent notifications and ... all by default.
watcher is a user field or ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the watcher field is a multi-select user field.
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.