Hello, I'm trying to create issue with Jira Cloud Rest API, but I'm not sure why I got this error. Even though I'm an admin on that project. I'm really confuse right now. Last time it success to create the issue, but today it didn't success.
{
fields: {
project: {
key: 'WT'
},
summary: 'I\'m not sure.',
description: {
type: 'doc',
version: 1,
content: [
{
type: 'paragraph',
content: [
{
text: 'Test create issue.',
type: 'text'
}
]
}
]
},
issuetype: {
name: 'Task'
}
}
}
Being an admin seems to be a MAJOR MISCONCEPTION with new users. Jira uses the permission scheme assigned to the project to determine what a user can do in the project. A security model where just being an admin gives you rights to everything is a BAD MODEL and would never pass a valid security audit. If you're a JIra admin you can look at the permission scheme assigned to the project and see what roles can create issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my Permissions Scheme, but I can create from Postman lol. I don't know its because of my Code is wrong or something else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just fixed the problem, there's something problem with my code which make that error appear lol. 🤦🏼♂️
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Haziq Izzat Could you please update the working code. I am also facing the same issue
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.
Was anyone able to resolve the issue? I am having the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't remember what I had change to the code, I think I missing scope for Auth, try to compare these scope with yours.
read:application-role:jira, read:issue-meta:jira, read:issue-security-level:jira, read:issue.vote:jira, read:issue.changelog:jira, read:avatar:jira, read:issue:jira, read:status:jira, read:user:jira, read:field-configuration:jira, read:issue-event:jira, write:issue:jira, write:comment:jira, write:comment.property:jira, write:attachment:jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Haziq Izzat . Were you trying to access the Jira API through an Atlassian app? I am trying to access it through an outside integration platform. Would changing the scopes still apply?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kasper Shwahla Did you mean by "outside integration platform" is your own application?... if yes, I'm doing the same thing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Haziq Izzat Were you able to solve this problem? I am facing the same issue when I try to create an issue through my Python script.
I am constantly facing the below error, (I tried through Postman as well, got the same error)
jira.exceptions.JIRAError: JiraError HTTP 404 url: https://subodh.atlassian.net/rest/api/2/project/TTS
text: No project could be found with key 'TTS'.
response headers = {'Date': 'Sun, 11 Jun 2023 05:19:13 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Server': 'AtlassianEdge', 'Timing-Allow-Origin': '*', 'X-Arequestid': '9743337f28d7b797a480103ce89ab02d', 'X-Seraph-Loginreason': 'AUTHENTICATED_FAILED', 'Cache-Control': 'no-cache, no-store, no-transform', 'Content-Encoding': 'gzip', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'Atl-Traceid': '90699ad459c4c7c1', 'Report-To': '{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}', 'Nel': '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload', 'Transfer-Encoding': 'chunked'}
response text = {"errorMessages":["No project could be found with key 'TTS'."],"errors":{}}
Here is my implementation:
try:
jira = JIRA('https://subodh.atlassian.net', basic_auth=('ksu11111@gmail.com', '1234566'))
except RequestException as e:
print('Response from jira: ' + str(jira))
# Create the JIRA issue
new_issue = jira.create_issue(project=project_key,
summary=summary,
description=description,
issuetype={'name': issue_type},
assignee={'name': assignee})
However when I log in to Jira and try creating an issue manually in TTS project. I am able to create it without any issues.
Also, when I hit the URL 'subodh.atlassian.net/rest/api/2/project/TTS' in the browser, I get details of the TTS project back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am able to solve this issue, the problem is that you have to use the API token in basic auth instead of password. Here is the procedure for the benefit of everyone.
Create your token here: https://id.atlassian.com/manage-profile/security/api-tokens
Here is the body of the post-call:
You can refer to this video also, its very helpful: https://www.youtube.com/watch?v=pcNqjBlhipU&feature=youtu.be&ab_channel=HongLyTech
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Issue: I was facing a similar issue with jira, through postman I was able to create the issue. But when using the same creds through python, it raised this exception
You do not have Permission to create issues in the Project
Fix: Something is wrong with your payload or your code and is most likely isn't an issue with access to that specific project
I was able to succesfully create the issue after fixing some issues with my code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Administrator needs to give you permissions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.