Need to create default assignee if issue status gets changed to "Test"

Hello,

I need to create default assignee in case issue status is changed to "Test". I tried to apply the rule below but it didn't work. We use YouTrack 4.1.1 (build #5680)


rule Assign to Denis

 when State.becomes({Test})
{
var qa = project.getUser("denis");
if (qa != null) {
Assignee = qa;
}
}

Thanks,
Denis
7 comments
Comment actions Permalink
Hi Denis,

the workflow looks correct, please describe what exactly doesn't work.
Please also attach the workflow.

Thanks
0
Comment actions Permalink
It seems that rule is not applied. When I change the status of an issue to "Test" assignee remains the same.
testing-workflows.zip (1.7KB)

Thanks,
Denis
0
Comment actions Permalink
Dmitry,

Do you need any additional information on this issue from me?  

Thanks,
Denis
0
Comment actions Permalink
Sorry for delay,

what do you see in log (youtrack.log) on state switching?
Is 'denis' user included in the current project assignee set?
Has logged in user appropriate permissions to change 'Assignee' field? ("Update Issue" if 'Assignee' is public and 'Update Private Fields' if private)?

Please also check if 'qa' is not null, e.g. by message("'denis' user: " + qa.fullName);
0
Comment actions Permalink
Hello Dmirty,

Thanks for following up on that.

1. Unfortunately I haven't found youtrack.log file. We don't provide hosting for our Youtrack instance is hosted somewhere else I guess it is spinning on your side.
2. Login 'denis' is included in my project   
3. Login 'denis' has admin permissions
4. Because of item #1 I was unable to insure that 'qa' is not null

Note: I mentioned 'Login' above because in youtrack user holds two connotations 'Login' and 'Full name'. In the rule I used value of 'Login' which is denis.

Regards,
Denis
0
Comment actions Permalink
youtrack.log (as weel as workflow.log) can be found in home_dir/.youtrack/logs.
3. Does logged in user (not denis, but who that changes state) has appropriate permissions.

You can check if 'qa' is null by the workflow:
rule set qa 
 
when State.becomes({Fixed}) { 
  var qa = project.getUser("denis"); 
  if (qa != null) { 
    message("qa user: " + (qa != null)); // appears in YouTrack screen
    debug("qa user: " + (qa != null)); //appears in workflow.log
  } 
}
prettyPrint();
0
Comment actions Permalink
Hello Dmitry,

I figure that out. Hopefully should work fine now. I didn't add workflow what I had created in "Youtrack-workflow" to Administration > Projects > Development > Workflow.I thought that "Upload to the server" from "Youtrack-workflow" is enough to make it work.  

Thanks,
Denis
0

Please sign in to leave a comment.