Workflow doesn't seem to fully run

I hope to get some help at least for this case (It looks like that if I don't start complaining, nobody will answer to my questions: I still 2 open and unanswered tickets in YouTrack, plus an unanswered email).

Anyway, please check this simple rule:
rule Required fields 
 
when !issue.isReported() { 
  Type.required("Please select an issue type"); 
  if (issue.Type == {Bug}) { 
    Affected versions.required("Please select at least one affected version"); 
    assert WP Version == "Undefined": "Please specify WordPress version installed by the user."; 
    assert PHP Version == "Undefined": "Please specify PHP version installed on user's server."; 
    assert Subsystem == {No subsystem}: "Please select the subsystem"; 
  } 
}


When a reporter add an issue without one or more required fields, he does see the notifications on the top of the screen, but he's still able to submit the ticket: why?

I want user to be unable to submit tickets without adding the required values.
"WP Version" and "PHP Version" are simply string fields (and I can't set them as required, apparently). Their default value is "Undefined" (ctrl-space doesn't propose this value, so I have to manually enter it).

"Affected versions" is a field used among other projects, where this value is not always required, so I want to make it mandatory only here (the field is shared among projects, but I use different bundles for different projects).

I hope you have everything you need to help me.
0
9 comments
What exact message do you see on the top? For string comparison please use "text".eq(args, opts).

If you want to compare a field value with a default 'empty' value please use null, e.g. assert WP Version == null: "Please specify WordPress version installed by the user.";
0
Avatar
Permanently deleted user
Please watch this screencast to see the notifications I'm getting.

This is the updated rule:
rule Required fields 
 
when !issue.isReported() { 
  Type.required("Please select an issue type"); 
  if (issue.Type == {Bug}) { 
    assert WP Version == null: "Please specify WordPress version installed by the user."; 
    assert PHP Version == null: "Please specify PHP version installed on user's server."; 
    Affected versions.required("Please select at least one affected version"); 
    assert Subsystem == {No subsystem}: "Please select the subsystem"; 
  } 
}


As you can see, now reporter is blocked from submitting the issue, but he also get stuck on it: no way to get our from that rule.
0
Try to user becomesReported() instead of !issue.isReported(). Such a way you will be able to fill the fields sequentially.
0
Avatar
Permanently deleted user
Thanks Dmitry.

Almost there.

Now I can go further the issue reporting, but got something new (see attachment).

Basically I'm asked to select the subsystem, I do so, then I try to click on "Create issue".
Issue doesn't get created and I keep getting asked to select the subsystem, even if it's already selected.
0
Is the Subsystem change really applied? Check it be page refreshing.

Please also attach screenshot/screencast.
0
Avatar
Permanently deleted user
Yes it is refreshed.
However if I manually refresh the page, I can submit the ticket, so it looks like the refresh done by YT is not an actual refresh.

Also, the fact that I can submit the ticket it's a sign the the workflow rule is still not fully working, as I' supposed to be asked to fill the WP and PHP version fields (that are empty/undefined).
0
Please try to use the 'require()' method also for the string fields.
0
Avatar
Permanently deleted user
Right.

require() works with all fields, and it's even better than using assert, as it doesn't show that annoying "Assertion error" string in the notification.

Thanks Dmitry!

I wish the tickets I've created in YT could get answered as well promptly.
0
Please sent waiting for the answer issue numbers to youtrack-feedback@jetbrains.com or list here.
0

Please sign in to leave a comment.