I'm using a simple scripted validator to ensure the assignee is set.
Testing for Unassigned is selected by:
!(!issue.assignee)
How can I check if the field is set to "Automatic"?
Thanx a bunch!
You can actually access what the user entered on the Transition screen using this code:
if (ActionContext.getParameters() != null) {
String[] assigneeSelected = (String[]) ActionContext.getParameters().get("assignee");
if (assigneeSelected != null && assigneeSelected.length > 0) {
selectedAssigneeName = assigneeSelected[0];
if (selectedAssigneeName.equals("-1")) {
// the user selected "automatic"
}
}
}
Thanks for correcting my misconception. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By the time the issue is accessed by the validator, the assignee should be set either to the project lead or component lead based on the configuration.
I don't think it's possible to know if it was so because the reporter selected that user or it was automatically applied by the project/component configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.