How to track reactions in workflow?
Hello,
Is it possible to track reactions to a comment via workflow?
I tried to do this with this script:
const entities = require('@jetbrains/youtrack-scripting-api/entities');
exports.rule = entities.Issue.onChange({
//exports.rule = entities.IssueComment.action({
title: 'Track-smiles',
guard: (ctx) => {
return ctx.issue.editedComments.isNotEmpty();
},
action: (ctx) => {
const issue = ctx.issue;
ctx.issue.editedComments.forEach(function(cmnt){
console.log(cmnt);
});
},
requirements: {
}
});
It triggers twice (why??), but there is no reaction data in the comment structure.
I found this article about working with reactions via API, but I need to work with them via workflow.
Thanks.
Please sign in to leave a comment.
P.S.
It triggers twice because of a bug:
https://youtrack.jetbrains.com/issue/JT-77053