[RESOLVED] How to add users to Watchers?

Hello,

I'm trying to add multiple users to Watchers, but I can't. Here's what I've tried. What am I doing wrong?


    function uAddWatchers(username) {
      //console.log("Username: " + username.login);
      
      // These attempts are causing the error
      //issue.applyCommand("add tag Star", username);
      //issue.applyCommand("star " + username.login, username);
      
    // These three add the user to the Visibile to list, not the Watchers list.
      //username.watchIssue(issue);
      
      //issue.applyCommand("star " + username.login);
      //issue.applyCommand("watcher " + username.login);
  }
0
4 comments
Hi!

The following code works fine:

let username = entities.User.findByLogin('User_name');
ctx.issue.applyCommand("star " + username.login, username);

What error does it show?
0

Hi,

Command [star Username] is invalid:,

I tested on a test environment and used blocked users. Everything works with unlocked users.
A very subtle error...

0
It seems that the command parser doesn't show a proper error for such command. I've created [a bug about that](https://youtrack.jetbrains.com/issue/JT-72849/No-error-message-for-star-command-if-user-is-banned), so workflow should provide a more detailed error when the bug is fixed.
0

Please sign in to leave a comment.