Why can't I set reporter for issues in some projects?

Michał Sikora January 8, 2020

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."}}

1 answer

1 accepted

0 votes
Answer accepted
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2020

Michal,

  According to the error the field reporter is not on the appropriate screen.  You should check the screen schema for the project make sure that reporter is on the screen associated with the create operation. 

Michał Sikora January 8, 2020

Hey Brant,

Yes, "Reporter" field is present on the creation screen for both projects. I thought it might be some sort of authorization issue as I found this post - https://community.atlassian.com/t5/Jira-questions/Create-issue-Getting-error-on-Reporter-quot-Field-reporter/qaq-p/68727. Do I need to check it somewhere specifically for the creation schema? Or might there be some project specific restriction for setting the reporter?

Michał Sikora January 8, 2020

Oh, my bad. I checked wrong. I can't see right now if "Reporter" is present for both. I'll get back to you tomorrow once I'll be able to check it. Thanks in advance!

David_Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2020

Just a clarification of what Brant said. The Reporter field needs to be on the Edit screen, not the Create screen if you want to interact with it via the REST API.

Most project schemas use a single screen to hold all the fields, but some schemas split the screens individually. That's probably what's happened in your case; the Reporter field is on the Create and View screens, but not on the Edit screen.

Personally, I think Atlassian should alter the error response to say "the field is not on the Edit screen" instead of "the field is not on the appropriate screen", since there really is only one screen that's 'appropriate'  :)

Michał Sikora January 8, 2020

Are you certain about that? When I use my personal account in our JIRA I can see "Reporter" field for editing (although it is disabled for me in failing projects) but not for creation. I use POST on the endpoint before the issue is created so I would assume that it cannot be edited yet, as there is no issue to edit. I might be wrong about this because I don't know JIRA internals but I want to be sure.

David_Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2020

Yep, 100% sure. It's in the REST API documentation somewhere, and I've run into the problem from time to time.

Just because you can see / edit a field on the Create and View screens, if you can't see / edit it on the Edit screen, the call from the REST API to alter it will fail with that error.

To be sure, open the issue, then click the Edit button in the top left to show the Edit screen. Can you see / edit the Reporter field via that screen with that user's account?

Michał Sikora January 8, 2020

Ok, thanks for the info! I'll check that tomorrow as I don't have the access right now.

Suggest an answer

Log in or Sign up to answer