Hello. I have a standalone YouTrack 2017.2 server, working as a HelpDesk. On issue creation I would like to set up some of its fields automatically, so support engineer would have much easier life. Right now I am struggling with "Affected version" field. I have defined set of project versions with release dates, archived and released flags in the project properties. On issue registration, workflow should scan this list, find versions that has been released, but were not archived and assign them to the issue's affected versions field.
Right now I managed to create this workflow script for the task:
var versions = issue.fields['Affected versions'];
if(!v.isArchived && v.isReleased )
This however is not right. Issue by default has an empty set of affected versions, so loop would never execute. I have tried var versions = issue.project.fields['Affected versions']; instead. This however throws an exception TypeError: Cannot call method "forEach" of undefined (configure-support-issues/set-issue-fields#26)
So question is: How to access all members of enumeration, defined for the project.