Getting comment ID in workflow
Hello, i'm currently working on integrating our company case management system with youtrack, and so i need to update comment content in our system when youtrack comment changes. In order to do this, i store youtrack comment id in external system by sending http request inside workflow.
However, i have problem with getting youtrack comment id from workflow code. The solution i found is extracting it from comment.url property.
It seem to work fine, but i have another workflow, which is triggered upon comment edit (guard condition is ctx.issue.editedComments.isNotEmpty() ).
And that workflow is triggered upon posting comment, yet it's pointed out in documentation, that editedComments is empty on new comment - https://www.jetbrains.com/help/youtrack/standalone/2017.4/v1-Issue.html
Turned out that accessing comment.url inside add comment workflow also triggers edit comment workflow.
The add comment workflow is:
ctx.issue.comments.added.forEach(function(comment) {
console.log(comment.url);
});
So i need help -
whether to get comment id in add workflow
or to avoid triggering edit workflow
Please sign in to leave a comment.
Hello, could you please share the full code of both rules in question? Thank you!
On add:
This code can actually be reduced to only accessing comment.url property ( for example console.log(comment.url) ) inside forEach
On edit:
There you can add console.log( ctx.issue.editedComments.isNotEmpty() ) inside guard
get_comment_id file:
Which YouTrack build number are you using? Are there any particular details about how and where in the UI you're adding comments? Unfortunately, at the moment we can't reproduce this issue ourselves.