Unable to create issues on Jira Cloud as app?

Hi,

I am simply trying to create a Jira issue from my app (by using the app’s account, not by acting as a Jira user) and it does not work.

POST /rest/api/3/issue/

with this JSON body

{“fields”:
{“summary”:“This is my issue summary”,
“issuetype”:{“id”:“10002”},
“project”:{“id”:“10000”}}
}

The error I get is the following:

Received http error code 400 when accessing the JIRA system. JIRA server response: {“errorMessages”:[],“errors”:{“summary”:“Field ‘summary’ cannot be set. It is not on the appropriate screen, or unknown.”}}

It happens for both nextgen and classic projects.

The API documentation says that the required app scope is WRITE.

I tried the following scopes but it does not help.
“scopes”: [
“READ”, “WRITE”, “ACT_AS_USER”, “ADMIN”, “PROJECT_ADMIN”
]

Acting as user creates the issue, but my app does not need to act as user.

Is this a known limitation/bug or I am doing something wrong?

Any help is greatly appreciated.

Thank you,
Danut Manda

Hi, are you sure that you are passing correct issuetypeId? I encounter an exact errorMessage and at first was thinking something is wrong with the field “summary”. Later I have found out that I have set incorrect issue type (not from that project)

Hi Maciej,

Yes, that is correct. The same code works if I impersonate the current Jira user. What else could be? Thanks!

Danut.

I would strongly consider evaluating if you’ve generated a valid JWT (incl. query string hash) for the request. You can view the contents of the JWT and check the QSH here: http://jwt-decoder.herokuapp.com/jwt/decode

1 Like

We have looked again as @remie recommended and indeed it was a token related problem.

On that specific code path from our library the token was not added at all to the request.

Thanks @remie for your insightfull response.

1 Like