add submitter as watcher
I'd like to add the person that submits a ticket as a watcher automatically. I see in http://forum.jetbrains.com/thread/YouTrack-411 something that looks like it should work but I'm getting warnings/errors with this script:
rule AddSelfAsWatcher
when <issue created or updated> {
loggedInUser.watchIssue(issue);
}
The error I'm getting loading in to the test youtrack instance is
"missing name after . operator (Default Watcher->AddSelfAsWatcher#4)"
I'm not sure what I'm missing here.
rule AddSelfAsWatcher
when <issue created or updated> {
loggedInUser.watchIssue(issue);
}
The error I'm getting loading in to the test youtrack instance is
"missing name after . operator (Default Watcher->AddSelfAsWatcher#4)"
I'm not sure what I'm missing here.
Please sign in to leave a comment.
Since Yourtack 4.0 you can user 'becomesReported()' trigger:
rule auto-watch when becomesReported() { loggedInUser.watchIssue(issue); }Will we need to wait for the upgrade to get this feature or is there a way with the previous 3.3 releases?
Thanks for any info
Note, Youtrack inCloud will be upgraded to version 4.0 pretty soon.
I was able to get the original rule (I had to create a new workflow and stateless rule which had the 'when' line pre-populated, then type -not paste- this code in the body in or to get the workflow editor to stop throwing bogus errors):
rule AddSelfAsWatcher when <issue created or updated> { loggedInUser.watchIssue(issue); }But, when I go to remove myself from an issue with the command:
I am still a watcher. Which means I am being re-added as a result of removing a wacther and thus updating the issue?
Is there a way to allow users to remove themselves from the watch list with this rule in place?
Yep, this rule has empty condition to invoke (<issue created or updated>), so it's invoked on any issue change.
To avoid this behavior you have to add some condition on the rule, e.g. becomesReported() to watch creating issue:
rule auto-watch when becomesReported() { loggedInUser.watchIssue(issue); }