Trying to itterate through all issues assigned to specific user

These if statements don't seem to trigger.  Does anyone see any reason why?  

var uIssues = u.getIssues(Everything,"Assignee:Scott");
var openIssuesCount = 0;
var InProgressIssuesCount = 0;
for each i in uIssues {
  if (i.State == {Open} ) {
   openIssuesCount=openIssuesCount+1;
  }
  if (i.State == {In Progress}) {
   InProgressIssuesCount = InProgressIssuesCount + 1;
  }
}
prettyPrint();

openIssuesCount and InProgressIssuesCount always equal 0, but I know there are issues in these states.


I tried comparing i.State to the following
  • {State: Open}
  • "Open"
  • {Open}

None of these works.
2 comments
Comment actions Permalink
Please try to include the debug print:
- message("State: " + i.State.name); - it'll show the message on the full issue screen for the stateless rule/state machine
- debug("State: " + i.State.name); - it'll print the message to the youtrack.log/workflow.log for all kind of rules
0
Comment actions Permalink
I actually found out the problem was a silly error further up in my code.  The debugging helped me find it though, so I'll mark that as the answer.
0

Please sign in to leave a comment.