Read an issue from JIRA rest api

Hi guys,

Im try to create a new issue from a python script BUT using a dict.

However the api say that i have no permission for do that (not even if i want to see an issue)

how can i fix that?

import base64
import urlparse
from tlslite.utils import keyfactory
import oauth2 as oauth
from jira.client import JIRA

from jira.client import JIRA

jira = JIRA()
jac = JIRA(options={'server': 'https://xxx.atlassian.net'})

key_cert_data = None
with open('./jira.pem', 'r') as key_cert_file:
        key_cert_data = key_cert_file.read()
        oauth_dict = {
                'access_token': 'xxxxxx',
                'access_token_secret': 'xxxxxx',
                'consumer_key': 'hardcore',
                'key_cert': key_cert_data
        }
        authed_jira = JIRA(oauth=oauth_dict)
        issue = jira.issue('LEET-1')

1 answer

0 votes
Pedro Cora Atlassian Team Sep 18, 2013

Check if the user that is logging to browse the issue has permissions to open this issue through the interface. The user making the REST call needs to have the proper Project Permissions to view the issue on the interface.

jira.exceptions.JIRAError: HTTP 400: "{u'description': u"Field 'description' cannot be set. It is not on the appropriate screen, or unknown.", u'summary': u"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."}"

https://einyxx.atlassian.net/rest/api/2/issue

I can actually do it from jirashell itself.

I'm doing something wrong code side?

from jira.client import JIRA

jira = JIRA()

jac = JIRA(options={'server': 'https://einyxx.atlassian.net'})

key_cert_data = None

with open('./jira.pem', 'r') as key_cert_file:

key_cert_data = key_cert_file.read()

oauth_dict = {

'access_token': 'jSD2JuIGdkOsqZA5QCo0yBtFaJDYIsxb',

'access_token_secret': '0qQUZHvSjToz0UC7OkwxaN8uWXuTXM4d',

'consumer_key': 'hardcore',

'key_cert': key_cert_data

}

authed_jira = JIRA(oauth=oauth_dict)

issue_dict = {

'project': {'key': 'LEET'},

'issuetype': {'name': 'Bug'},

}

new_issue = jira.create_issue(fields=issue_dict)

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,167 views 13 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot