Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira python Getting error on assignee --> TypeError: 'Resource' object is not subscriptable

Joy Elamthuruthy November 2, 2018

         

for issue in issuelist:

      print (issue.fields.assignee.key) 

 

this code was running fine for about 3 months and started gettign the following error yesterday:

Traceback (most recent call last):

  File "/Users/jmathe200/.virtualenvs/jira-py/lib/python3.6/site-packages/jira/resources.py", line 157, in __getattr__

    return self[item]

TypeError: 'Resource' object is not subscriptable

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):

  File "/Users/jmathe200/workspace/xmdmpy/jira-py/extractjiramain.py", line 48, in <module>

    j.dump_issues()

  File "/Users/jmathe200/workspace/xmdmpy/jira-py/extractjira.py", line 197, in dump_issues

    print (issue.fields.assignee.key)

  File "/Users/jmathe200/.virtualenvs/jira-py/lib/python3.6/site-packages/jira/resources.py", line 170, in __getattr__

    if hasattr(self, 'raw') and item in self.raw:

TypeError: argument of type 'NoneType' is not iterable

 

=========

xxxx-874 <-- this is the ticket failed.  but https://zzzz.atlassian.net/rest/api/2/issue/xxxx-874 does provide the correct value in the respose jason for "assignee"

 

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 2, 2018

I suspect that you are seeing the changes as a result of https://developer.atlassian.com/cloud/jira/platform/api-changes-for-user-privacy-announcement/

Atlassian Cloud is in the process of making changes to the way rest api can make requests to the user objects.  Instead of returning usernames, like 'jason', Jira Cloud will start using accountid instead.

Joy Elamthuruthy November 5, 2018

I think i was using jira 1.05 pkg.  I upgraded to 2.x, and pretty much got me running.  I had to make minor code changes.

Like Hailey likes this
Joy Elamthuruthy November 5, 2018

Thanks Andew, the URL provided me got me thinking I was using older pkg

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events