For anyone here who has used Jira-Python, if I'm using vim to edit my code, how do I display all issue fields for my project?
Here is the link of the doc
https://jira.readthedocs.io/en/master/
and attached picture shows all the common fields of an issue but my companies fields might be different.
Hi!
Please, try to use the Pycharm, or vs code to edit.
regarding to view in one shot I do recommend a look into postman side
Were you able to do this? Trying the same thing and having a fairly hard time.
You can use
issue.raw[<span>'fields'</span>]
to get all the results obtained in the JSON object as raw string. Its not as pleasant to view, but will provide you with what you're looking for. Take a look at this stackoverflow solution and see if you find your answer, cheers.
I would go this way:
project_keys = ['Zen']issuetype_names = ['Task']meta = jira_instance.createmeta(projectKeys=project_keys, issuetypeNames=issuetype_names, expand='projects.issuetypes.fields')for x in meta: ...
Basically gives you all info, datatypes, options etc. attached to the individual fields in the corresponding project/issuetype. This also gives you the field name to the customfield_123456 fields, translations etc.
I made a web application using plotly/dash on Python to make an interactive Jira work log dashboard. Users who are viewing the answer to this question might find something valuable there. You can visit this GitHub repository.
I know this is old but this might help someone else down the road. You can do this to just get the field names: print(sorted(thisIssue.raw['fields'])if you even better clarity (but more scrolling), you can put them each on a newline: print("\n".join(sorted(thisIssue.raw['fields'])))
I added this to an answer above but thought I would expand it here: I'm using this JQL to get issues that fall within a date range for a project:
from jira import JIRAfrom jira.client import ResultListfrom jira.resources import Issueimport osimport datetimeimport json#set date rangesdtOneYearPast = datetime.datetime.now() - datetime.timedelta(days=3*365)dtThreeWeeksPast = datetime.datetime.now() - datetime.timedelta(days=21)#convert to stringsstrOneYearPast = formatDateString(dtOneYearPast)strThreeWeeksPast = formatDateString(dtThreeWeeksPast)strJQL = "project=KME AND status = 'Code Review' OR status = 'IN QA - DEV' OR status = 'IN QA - STG' AND createdDate > " + strOneYearPast + " AND createdDate < " + strThreeWeeksPast
and grabbing the first response and outputting the fields, sorted ascending, each field on its own line here:
for thisIssue in jira.search_issues(strJQL, maxResults=250, expand='changelog'): print("\n".join(sorted(thisIssue.raw['fields']))) break
It looks like you're new here. Sign in or register to get started.