AttributeError: type object 'PropertyHolder' has no attribute 'issuelinks'

Prathima Reddy August 27, 2018

Hi,

I am trying to retrieve the issuelink associated with an issue using jira-Python. But, receiving following error: 

AttributeError: type object 'PropertyHolder' has no attribute 'issuelinks'

Code:

issueKey = 'RM-9948'
issue = jira.issue(issueKey)
print(issue.fields.summary)
print (issue.fields.customfield_10115)
print (issue.fields.customfield_10116)
print (issue.fields.customfield_10117)
print (issue.fields.customfield_10146)

print(issue.fields.issuelinks)

I am able to get all other field values including subtasks except issuelinks. Any help will be appreciated.

Versions:

Jira : - 7.4.3

Python :- 3.7

Jira-Python :- 2.0.0

Thanks,

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2018

Links are not a field.  Try getting them directly from the issue.

Prathima Reddy August 27, 2018

Thanks Nic!! Tried directly from the issue but still not working.

issueKey = 'RM-9948'
issue = jira.issue(issueKey)

print (issue.issuelinks)

Also, tried print (issue.links)

Receiving below error:

Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\jira\resources.py", line 161, in __getattr__
return self[item]
TypeError: 'Issue' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\SRE-Tools\SourceCode\jiraExampleCmds.py", line 15, in <module>
print (issue.issuelinks)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\jira\resources.py", line 177, in __getattr__
raise AttributeError("%r object has no attribute %r (%s)" % (self.__class__, item, e))
AttributeError: <class 'jira.resources.Issue'> object has no attribute 'issuelinks' ('Issue' object is not subscriptable)

 

As per the latest Jira-Python documents - https://jira.readthedocs.io/en/master/jirashell.html lists issuelinks access using issue.fields property:

issue.fields.issuelinks

 

Prathima Reddy August 28, 2018

Thanks, Nic!! Tried directly from issue but still not working.

issueKey = 'RM-9948'
issue = jira.issue(issueKey)

print (issue.issuelinks)

Also, tried print (issue.links)

Error.PNG

As per Jira-Python docs - https://jira.readthedocs.io/en/master/jirashell.html , issue links must be retrieved using issue.fields property:

issue.fields.issuelinks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events