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.

https://www.jetbrains.com/help/youtrack/devportal/resource-api-issues-issueID-comments-commentID-reactions.html

I found this article about working with reactions via API, but I need to work with them via workflow.

Thanks.

0

Please sign in to leave a comment.