In Jetbrains YouTrack, there is own made (HelpDesk) workflow it work fine. When a new email come in it make an Issue and check the Riporter's email (reporterEmail). It add a tag to the Issue by the reporterEmail.
I used first Issue.addTag method, reference. It works when any of 'Support Admin' change anything in the Issue. (The tag is added). But it is not added at the first come in.
After a few hour research I found the problem (I don't receive any errro in console). There is no permission to the Tags and I can not grant permission to the riporters (because it is a special group). In next solution: I went over to Issue.applyCommand method. reference
Firstly some problems with the user (main-user entity). After a few try, it seems work. No error message. But the Tag is not added. I think i my command add tag {testg} is wrong what is would to apply:
if (reporterEmail.includes("[email protected]")) {
console.log('testRun'); //it is shown at the console
issue.applyCommand("add tag {testg}", mainUser);
isTag = true;
}
add tag {testg} It works in normal command window (on server public gui), but not in the workflow script.