Hi, I'm writing a tool for creating JIRA issues via the REST API. I have a problem where the user that is configured for the tool is able to fully interact with it in one project but not in others. When I try to create an issue it fails if I try to set a reporter for the issue. As far as I could find it's a problem with access rights but I cannot figure out why it might be as the mentioned user has the same roles in both projects.
This one is successful:
curl -X POST -H "Authorization:Basic REDACTED_AUTH_TOKEN" -H "Content-Type:application/json; charset=UTF-8" -H "Content-Length:613" -H "Host:droidsonroids.atlassian.net" -H "Connection:Keep-Alive" -H "Accept-Encoding:gzip" -H "User-Agent:okhttp/4.3.0" -d '{"fields":{"project":{"key":"MSS"},"issuetype":{"id":"1"},"summary":"Bug summary","reporter":{"id":"5c53013439ca604edaa6cdef"},"description":"{panel:title=Application info}\nVersion name: 1.0\nVersion code: 1\nPackage name: io.mehow.squashit.sample\n{panel}\n\n{panel:title=Device info}\nManufacturer: Google\nModel: Android SDK built for x86\nSupported ABIs: [x86]\nResolution: 2028x1080\nDensity: 440dpi (xhdpi–xxhdpi)\nLocales: [en_US]\nLocal date: 2020-01-08T16:54:03.227+01:00\nTime zone: Central European Standard Time, Europe/Warsaw\n{panel}\n\n{panel:title=OS info}\nRelease: 10\nSDK: 29\n{panel}\n\n"}}' "https://droidsonroids.atlassian.net/rest/api/2/issue"
This one fails:
curl -X POST -H "Authorization:Basic REDACTED_AUTH_TOKEN" -H "Content-Type:application/json; charset=UTF-8" -H "Content-Length:612" -H "Host:droidsonroids.atlassian.net" -H "Connection:Keep-Alive" -H "Accept-Encoding:gzip" -H "User-Agent:okhttp/4.3.0" -d '{"fields":{"project":{"key":"MK"},"issuetype":{"id":"1"},"summary":"Bug summary","reporter":{"id":"5c53013439ca604edaa6cdef"},"description":"{panel:title=Application info}\nVersion name: 1.0\nVersion code: 1\nPackage name: io.mehow.squashit.sample\n{panel}\n\n{panel:title=Device info}\nManufacturer: Google\nModel: Android SDK built for x86\nSupported ABIs: [x86]\nResolution: 2028x1080\nDensity: 440dpi (xhdpi–xxhdpi)\nLocales: [en_US]\nLocal date: 2020-01-08T16:50:04.446+01:00\nTime zone: Central European Standard Time, Europe/Warsaw\n{panel}\n\n{panel:title=OS info}\nRelease: 10\nSDK: 29\n{panel}\n\n"}}' "https://droidsonroids.atlassian.net/rest/api/2/issue"
{"errorMessages":[],"errors":{"reporter":"Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."}}
Hi Michal,
I see that you are making essentially the same REST API call to two different projects here where one is working and the other is not. The key detail here is in the error message:
{"reporter":"Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."}
This message is thrown because of a couple of different potential causes.
Cause #1: In Jira, for that project, and that issue type, the create screen does not contain the reporter field. This is something that a Jira Admin/site-admin can configure within the project. When this happens, a Jira admin would need to add that field to the create screen for that issuetype in that project to be able to do this. Steps to do this are in Defining a screen.
Cause #2: In Jira Service Desk (JSD), the assignee's are typically restricted to only be able to be user accounts that are licensed as Jira Service Desk Agents. Not sure if your MK project is a JSD project or some other project type, but it could potentially throw this error.
Cause #3: This error message can be thrown when the account you are using to try to create issues simply does not have the permissions to create issues in this project. I think this is the most likely cause here. This can be confusing though because Jira is trying not to disclose too much information to you about why this failing, and a lack of create permissions or assign permissions on the project could potentially result in this kind of error.
I would suggest that you try to login to the Jira Cloud website directly in a browser, such as Chrome, Firefox, etc, with the same account that is making these REST API calls. Then go to this MK project to see if you can create a bug type issue in that MK project with that account. If successful, then see if you can set the reporter there too. If not successful, then you might want to ask a Jira admin to use the permission helper (/secure/admin/PermissionHelperAdmin.jspa) in order to understand your accounts' permissions here.
Try this and let me know the results.
Andy
Hi Andy,
First of all thank you for your very detailed response.
When I created this issue in this community it disappeared for me after I edited the title and I thought it was gone as I couldn't find it neither in my history nor in the recents list. I created another one in Jira Cloud (https://community.atlassian.com/t5/Jira-questions/Why-can-t-I-set-reporter-for-issues-in-some-projects/qaq-p/1264984) after that.
The issue was with the Reporter field missing which one of our admins did enable today for some users. Sorry about the trouble and again thank you.
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.