Cannot use becomes function on user with parametr isBanned

I need to go thru all users and check if someone became banned recently.
I do this by becomes function that does not seem to work for fields that are not of Type string.

var users = entities.UserGroup.findByName("All Users").users;
users.forEach(function(user) {
  if(user.becomes("isBanned", "true")){
  console.log('someone became banned');

  ...
  }
});

Am I doing something wrong? Thank you for answer.
Petr

4 comments
Comment actions Permalink
Official comment

Hello,

Our workflow can detect only changings related to issues, like summary, description, comments, custom fields, work items, etc. So, it is impossible to detect the changing of user properties. 

Should you have any further questions, feel free to contact us.

Comment actions Permalink

Thank you, I understand.
I might have just misinterpreted your documentation, but I do not undestand why do you have `becomes` function on this( https://www.jetbrains.com/help/youtrack/standalone/v1-User.html#becomes) page if it is impossible to detect any change on user. Could you please explain this to me?

I tried to use the function with some of the fields that return String and it seemed to work. Anyway it would be nice functionally to be able to check User changes since it is quite common in some companies.

Cheers,
Petr

0
Comment actions Permalink

The becomes method is common for most entities. I have created a separate https://youtrack.jetbrains.com/issue/RDOC-1484 task to correct our documentation. Please feel free to vote for this to increase its priority and to receive the updates. 

As for the user.becomes property, I have passed your idea to our team. However, I am not sure that this feature will be implemented in the nearest time. 

Should you have any further questions, feel free to contact us.

0
Comment actions Permalink

Thank you again,
I think that it would be great to correct the documentation so it does not misslead anyone.

0

Please sign in to leave a comment.