Hi there! Newbie here I'm trying to set up an automation rule that sends comments into a Slack channel when a specific user is mentioned, the assignee or reporter.
I'm using the Advanced compare condition and this is my initial if statement to check if the user is the one commenting. This doesn't seem to work as I would like it (I figured it's me who misunderstood something) because it just passes the first IF statement no matter who comments ----If: Compare two valuesChecks if: First value:{{issue.comments.author}}ConditionDoes not match regular expressionRegular expression.*\[~5ecd20a9730ec90c1988740c:.+\].* ----I have double-checked the ID should match the user. I tried following these two Questions: Solved: How to trigger automation action if comment contai... (atlassian.com)Solved: How to make a rule that triggers an action when a ... (atlassian.com)This is all of the automation.
@Niklas Missel, I'm not sure why you need all those extra things in your regular expression. Mine worked just fine like this:
First, you're using `does not match` which is generally going to match lots of things. Anything that doesn't match the regular expression.
Also, this regex:
.*\[~5ecd20a9730ec90c1988740c:.+\].*
doesn't contain the accountid: portion of a user mention. Both of the threads you linked used `.*\[accountid:~.+\].*`. The "accountid:" portion is meaningful.
Okay, it still doesn't seem to do the trick. The user still gets a slack message when they comment themselves.
So what I'm trying to achieve with this part of the statement is that whenever this specific user comments on an issue it shouldn't send a slack message. But if anyone else comments, where the user is either a reporter, assignee, or mentioned, a slack message is created. I'm not sure if the way I did it is either the best way or if it's correct. If there is a better way I'm all ears and eager to learn
Is 5ecd20a9730ec90c1988740c the account id? Jira / Atlassian use a couple of different representations of users. Internal to Jira it uses account ids which are usually of the shape `numbers:letters-numbers-l&n-l&n-l&n`.
You can figure this out by creating a simple rule which sends their account id to the audit log by logging a comment which mentions them:
After that, use that exact account id in the regex:
.*\[~accountid:557057:fdddddd-6633-46a3-9acf-123456789da2\].*
It seems to be the same AccountID as I tried earlier, although it doesn't seem to match what you described it should look like.
I have tried to update the RegEx with "accountid:...", it still just passes everything. Is there another way I can achieve my goal of not letting it pass a comment from a specific user? Or do you have some other comments on what I do wrong?
@Niklas Missel, How did you get their account ID? As I said, this rule worked just fine for me.
@Kian Stack Mumo Systems I got it by going to the admin user page --> clicking on the user --> see the Account ID In the URL. I confirmed the Account ID by following Wwalser's suggestion (See comment below):
It looks like you're new here. Sign in or register to get started.