Assignee from workflow search are always null

Maybe I'm missing something here, but I'm tryin to access the Assignee field after doing a workflow search. Code is below. I am able retrieve the correct number of issues and I can access custom fields via issue.fields["My Custom Field"]. I'm just not able to get the Assignee.

----------------------------

const entities = require('@jetbrains/youtrack-scripting-api/entities');

var search = require('@jetbrains/youtrack-scripting-api/search');
 
exports.rule = entities.Issue.action({
  title: 'test3',
  userInput: null,
  command: 'test3',
  guard: (ctx) => {
    return true;
  },
  action: (ctx) => {
    var query = 'Assignee:{All Users}';
var inProgress = search.search(null, query);
if (inProgress.isNotEmpty())
    inProgress.forEach(function(issue) {
if (issue.fields.Assginee == null) {
              console.log([issue.id, "IS NULL"])
            } else {
              console.log([issue.id, "IS NOT NULL"])
            }
    });
  },
  requirements: {
    Assignee: {
      type: entities.User.fieldType,
      name: 'Assignee'
    }
  }
});
0
4 comments
Hello,

I'm Lena from the YouTrack Team. Could you please specify if the Assignee field accepts single or multiple values?
0

The Assignee field is a single value. When I do a console.log it has the value of "{}" and passes the == null comparison.

0

Hi Rick. I noticed a typo on one of the lines: issue.fields.Assginee == null (should be Assignee). Fixing the typo should help, so I suggest trying that.

0

Stanislav Dubin A big thank you. That's rather embarrassing. I swore I used auto-complete, but guess not.

0

Please sign in to leave a comment.