Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 Jan 08, 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. 

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?

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!

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'  :)

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.

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?

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you