How do you know that an issue "enters" a particular board ?
Hi
I need to do a particular action each time an issue is affected to a particular agile board.
In OnChange rule, I can't figure out how to check that. Documentation is really poor on detailed stuff like that. I didn't find any existing rule that implements that either.
Many thanks.
Laurent
Please sign in to leave a comment.
Hello,
It is possible to implement this task by checking if the issue's sprint has been changed. For example:
var entities = require('@jetbrains/youtrack-scripting-api/entities');
var workflow = require('@jetbrains/youtrack-scripting-api/workflow');
exports.rule = entities.Issue.onChange({
title: 'Sprints-test',
guard: function(ctx) {
return ctx.issue.sprints.added.isNotEmpty();
},
action: function(ctx) {
workflow.message('Sprint is added: '+ctx.issue.sprints.added.get(0).name);
},
requirements: {
// TODO: add requirements
}
});
I hope it will be helpful. Should you have any further questions, feel free to contact us.
Hello
thanks for your help.
I tried something like that, but in my kanban board, when i add an issue, the line :
shows an empty array : (sprints are disabled in my kanban board)
so I can't find how to know that the issue has been added.
I'm able to retrieve the board like that :
Which gives me :
But from there I'm stuck. I can't find relations between issues and boards (not sprints), and even less detect changes in those relations.
Many thanks for your help.
Laurent
Would you please provide me with a code of your workflow? Also, would you please clarify which actions you are preforming in your issue?
Sure, here is the full code (I let the console calls to let you know what was tested) :
I'm testing this with removing then adding a User Story to the board named "PO V2 Kanban".
The issue enters the onChange rule, but the line
shows
As does the line
Thanks for your help.
Laurent
Hello Laurent,
Thank you for the attached code. This issue seems to be strange. Would you please clarify which version of YouTrack (inCloud or Standalone) you are using and specify the build number? Your cooperation is greatly appreciated.
Hello Oleg,
we're using Youtrack InCloud.
Thanks
Laurent
Thank you for the clarification. Would you please make sure that sprints are enabled for your board?
Hello,
I am afraid, for now YouTrack workflow does not allow getting issue's boards. It is only possible to get sprints.
Please feel free to vote for this feature request: https://youtrack.jetbrains.com/issue/JT-51898 to increase its priority and to receive the updates.
Hi, is possible now? I can do it?
Alexbaccanelli please check this documentation section.