Add new enum value to custom field in workflow by JS

Hello,

 

im using youtrack 2018.2 is it possible to add new value to custom field which is enum type?

 

For example i have custom field Area which is enum and by default contains Area01, Area02 and Area03. Then in workflow when user creates new issue (or something like that) i wana to add new value to this field Area04. Is this even possible?

I can access values of custom field Area by something like this

 

action: function(ctx) {
var issue = ctx.issue;

console.log('Pre ' + ctx.Area.values);

ctx.Area.values = null;

console.log('Post ' + ctx.Area.values);


},
requirements: {
Area:{
name: 'Area',
type: entities.EnumField.fieldType,
multi: false
}
}

 

but i cant change this values. Method .add() not working...

 

I even tried to achieve this by custom command. I thought that with enough permission i can add new value to custom field via command (screenshot)

But with this command i must click on Add button not Apply. Is this possible to do this by applyCommand?

0
1 comment
Official comment

Hello,

Unfortunately, it is not possible to perform any administration tasks in workflows, like adding new fields, new values, roles, users, etc.  

Please sign in to leave a comment.