tl;dr: halp!!!!
I'm using jira-rest-java-client-core version 2.0.0-m26.
The following code:
JiraRestClient restClient = FACTORY.createWithBasicHttpAuthentication(jiraServerUri, USERNAME, PASSWORD); Set<String> affectedVersionNames = new HashSet<String>(); affectedVersionNames.add("Mavericks"); ... issueInputBuilder.setAssigneeName("MrJobs"); issueInputBuilder.setFixVersionsNames(affectedVersionNames);
Exception in thread "main" RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={assignee=Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown., fixVersions=Field 'fixVersions' cannot be set. It is not on the appropriate screen, or unknown.}, errorMessages=[]}]}
Community moderators have prevented the ability to post new answers.
It turns out that 3) is the culprit as the error messages means something different: "Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown." doesn't mean that the field cannot be set within the Jira UI. It means that it can't be set from the issue creation dialog box.
The fix was to ask my company's Jira administrator to allow all users to be able to set assignees and fixVersions when they create new issues.
A hack that would have worked would have been to first submit the issues without assignees or fixVersions, fetch them again, and set set the assignee and fixVersions.
Er, no. The error message is correct.
The field assignee was not on screen. Because the user you are using does not have assign issue permissions, so Jira removes it from the edit screens.
The underlying reason is wrong, but the error message is correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"It is not on the appropriate screen, or unknown." is correct only if the user-developer mentally maps the API's functionality to the UI's functionality. If that abstraction is made, the underlying reasoning is actually correct because the fields weren't on the "appropriate screen", e.g. the Create Issue dialog box.
Given how many forum topics have been created about the same error message, I think many aren't making that mental abstraction.
Maybe an improvement the Altassian team could make would be to make this error message clearer to end users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, it's still correct - think of it this way - was the field on screen when you used the UI as that user?
The mental-map isn't necessary, just a look at the screen. There are a number of these cases where permissions can hide a field from use, and it's not really feasible to give the underlying cause because there's a maze of permissions that could be causing it to be off-screen. The error message "it's not on screen or not available" is correct, even if it's not the underlying cause
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It doesn't need to say the root cause. It just needs to say where the problem is if it's going to make analogies with the UI. Since I am creating an issue, the "appropriate screen" is always the Create Issue dialog.
Field 'assignee' cannot be set. It is not on the Create Issue screen, or unknown.
I didn't even know that "appropriate screen" had anything to do with the UI until I came here so checking the Create Issue dialog didn't even occur to me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I should have said, I'm not strongly disagreeing with you - it's just that the error message here is accurate. I completely see that it's confusing because it doesn't directly give you the root cause, be nice if it did.
There are quite a few more examples where Jira will give you an accurate but not-root-cause error message because there could be any number of different causes for the same behaviour.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It just needs to say where the problem is, not what's causing it. I didn't interpret "appropriate screen" to mean a UI object so seeing if the fields could be set in the Create Issue dialog didn't even occur to me. But it would have if I'd made the mental abstraction.
I may have if the error message said which UI object is the "appropriate screen". Since I am creating an issue, the "appropriate screen" is always the Create Issue dialog.
Field 'assignee' cannot be set. It is not on the Create Issue screen, or unknown.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem there is that it doesn't necessarily know that you're on the create screen. Again, that's a quirk of the internals, but yes, that would definitely be a better message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Start with a basic test - can you log into Jira as the user you are running the REST client as, and create an issue, setting the fixversion and assignee? If the web-ui can't do it, then REST won't.
The error message you're getting really does mean what it says in most cases - the system isn't configured to allow you to do what you're trying to do in REST.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From the error:
It is not on the appropriate screen, or unknown.
I suppose there are some problems with the Issue Screen.
Maybe assignee and fixversion are not contained in current screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm trying to set the fixVersion and assignee through the SDK (which connects to Jira OnDemand via the API), not through the UI. I don't even know what a "screen" is because the message is so cryptic. Could you please elaborate on what "contained in the current screen" means in reference to the SDK?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already tried that before I posted. I can create issues and set fixVersions and assignees, but I can't create new fixVersions and users. I shouldn't need the ability to create and delete new fixVersions to be able to _set_ an issue's fixVersion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, you mean that you do not know about what is JIRA Issue Screen?
You know, before you set any field on JIRA issue or create jira issue, you need to make sure all field you needed are included into your issue screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Creating a version is different from setting a version and done in a completely different place.
The error message is clear - you have not got the fields you need on the "create screen" for some reason. You say you're able to set them when using the gui, but are you 100% sure you are using the same user in REST? As different users can have different rights.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It might be clear to the people who developed the SDK but it's unclear enough for people who use the SDK that there's many topics on nearly identical error messages.
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.