ctx.issue.sprint.add doesn't work

Hi,

When trying to set the sprint of an issue, I run into the following issue: 

Cannot set value to custom field Sprints

Code looks something like this (board and sprint exists):

var board = entities.Agile.findByName("My Board").first();
var sprint = board.sprints.last();
ctx.issue.sprints.add(sprint);

Our sprints field seems to be of type version with support for multiple versions. I'm not sure how version relates to sprints, but from looking at examples this should be correct?

Thanks,
Christian

4 comments
Comment actions Permalink
Official comment

Hi,

Could you please attach a screenshot of sprints field settings (Projects -> your project -> Edit project -> Fields -> sprints)?

Also, please try the following option of adding an issue to a board:

issue.applyCommand('add Board ' + board' + 'Sprints ' + sprint, ctx.currentUser); 

Does it work for you?

Comment actions Permalink

Hi,

Thanks, that command actually did the trick.

Here's a screenshot of the sprint settings. Would be interesting to know if something is wrong.

0
Comment actions Permalink

Fields name are case-sensitive, so just use Sprints instead of sprints:

ctx.issue.Sprints.add(sprint);

Hope it helps. 

0
Comment actions Permalink

I tried that but it didn't make any difference. But the command works fine at least!

0

Please sign in to leave a comment.