New workflow editor (Pure JS) and fields with spaces

Answered

Hi. I'm trying a new editor right in the browser and there is a problem:

I would like to use such expression, for example:

var entities = require('v1/entities');

exports.rule = entities.Issue.onChange({
// TODO: give the rule a human-readable title
title: 'OnChange Rule',
action: function(ctx) {
var issue = ctx.issue;
console.log("issue was changed! Hi time is:" + ctx.issue.fields.Timer time);
},
requirements: {
// TODO: add requirements
}
});

 

The problem is here:

console.log("issue was changed! Hi time is:" + ctx.issue.fields.Timer time);

I can't use the fields with spaces

What can we do? I cant rename all fields with spaces, really.

Thanks. 

2 comments
Comment actions Permalink
Official comment

Hello Dmitry, please use the following syntax for names with spaces:

ctx.issue.fields["Timer Time"]

Comment actions Permalink

It works! Thanks you! Veeery nice!

0

Please sign in to leave a comment.