Workflow for notifying @mentions

Hello,

I'm trying to test out the "Notify User Mentioned in Comment" on http://confluence.jetbrains.com/display/YTD4/Customizable+Workflow+Repository.

I would like to modify this so that it works instantly and not require the user to put "remind " and a space behind it.  The following regext will find the @username:

regex: ([^a-z0-9_]|^|RT:?)(@+)([a-z0-9_]{1,20})(/[a-z][a-z0-9_\\-]{0,24})?

I have no idea if you can use regex or not, but does anyone have any suggestions?
2 comments
Comment actions Permalink
Unfortunately regular expressions aren't supports in the workflow language, I've created the feature request - JT-22631
0
Comment actions Permalink
Ok, so the alternative to regex is to have the script look for 4 things:

1.  Look for @ at the beginning of a line (like the first word in a paragraph) with a space after the username.  Example.  "@jimmy can you look at this?"
2.  Look for the @ after a space with a space after the username.  Example: "Did you know that @jimmy was working on this?"
3.  look for @ after a space with punctuation after the username.  Example 1: "Hey @jimmy, did you see this?".  Example 2: "I think we should get this done this week, what do you think @jimmy?"
4.  Look for @ at the beginning of a line (like the first word in a paragraph) with punctuation after the username.  Example.  "@jimmy, please look at this."

A way to do this without regex:
  • store the comment string in a variable (so we can edit the string without changing the actual comment)
  • loop through the string and do the following:

        - look for #1 above, if its found: notify the mentioned user & remove that mention from the string (we do this so that we can loop through the string multiple times an not notify that person again and again).  Keep looping through to notify other @mentions.
        - look for #2 above, notify and remove like above
        - look for #3 above, notify and remove like above
        - look for #4 above, notify and remove like above

I would love to have some help on how we can do this.

Thanks!
0

Please sign in to leave a comment.