Fetch properties using Jira Python client

Tarun Tarun April 22, 2021

Hi Team,

I was able in the past to use a JQL by using REST API in order to fetch a specific property from JIRA 

request_url = jira_base_url+'/rest/api/3/search?jql=project%3D%27'+projectCode+'%27%20AND%20syncedFactSheetCount%3E0&properties=leanix'

This was providing me the specified properties in the response, but as I am exploring the jira-python library I am not able to retrieve the properties when I try the below. Is there a way to fetch this information?

  jira = JIRA(options, basic_auth=("email", "apiToken"))
for issue in jira.search_issues('reporter = currentUser() order by created desc', maxResults=30,json_result=True,fields='summary')['issues']:
print(issue)

 

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 3, 2021

Hi @Tarun Tarun ,

After parsing through the source of the jira-python client, it appears that the library doesn't have a wrapper for entity properties, such as the issue property in your REST API example. There does appear to be a request to add properties to the client here in its open source project

I would suggest trying to use the REST API directly in your python code to get the properties, as the client cannot currently do it. Or if you're handy with python enough to extend the client, check out the contributing guidelines and submit a pull request to the client to get it added officially.

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events