Jira Python: Syntax error appears when trying to print

2024/11/14 23:39:24
from jira.client import jiraoptions = {'server': 'https://URL.com'}
jira = JIRA(options, basic_auth=('username', 'password'))issues = jira.search_issues('jqlquery')
for issue in issues:print issue

I want to print the output of the jql query.However, getting syntax error on the last line "issue".

Answer

The way to print the issue keys to your command prompt is:

from jira.client import jiraoptions = {'server': 'https://URL.com'}
jira = JIRA(options, basic_auth=('username', 'password'))issues = jira.search_issues('jqlquery')
for issue in issues:print issue

That will do it. However, you mention you get a syntax error for your JQL query, so you'll need to post that query to see what is wrong with it. Valid would be, for example if you want to find the issues you added label 'TEST' to in your previous question:

label = 'TEST'
issues = jira.search_issues('labels=' + str(label))

Or:

jqlquery = 'labels=TEST'
issues = jira.search_issues(jqlquery)
https://en.xdnf.cn/q/120493.html

Related Q&A

Matplotlib plt.xlim([x_min,x_max]), list object not callable

I want to plot a scatterplot, but set the x-label limits.axScatter = plt.subplot(111) axScatter.scatter(x=mean_var_r["Variance"],y=mean_var_r["Mean"]) xlim = [-0.003, 0.003] plt.xli…

Map column birthdates in python pandas df to astrology signs

I have a dataframe with a column that includes individuals birthdays. I would like to map that column to the individuals astrology sign using code I found (below). I am having trouble writing the code …

How to use python pandas to find a specific string in various rows

I am trying to do my taxes. I have over 2,000 rows of data in a CSV of orders. I am trying to just count and print the rows that contain "CA" so I know the ones I need to pay sales tax on. I …

How to cast a list to a dictionary

I have a list as a input made from tuples where the origin is the 1st object and the neighbour is the 2nd object of the tuple. for example :inp : lst = [(a,b),(b,a),(c,),(a,c)] out : {a: (a, [b, c]), …

Couldnt get rid of (_tkinter.TclError: bad event type or keysym UP) problem

I am running a Linux mint for the first time . I tried coding a python problem but for two days I am continiously facing problems due to Linux interface please This is my code:-import turtleimport time…

WMI lib to start windows service remotely

How do I start a service using the WMI library? The code below throws the exception: AttributeError: list object has no attribute StopServiceimport wmi c = wmi.WMI (servername,user=username,password=p…

TutorialsPoint - Flask – SQLAlchemy not working

I did all that was stated on tutorial point (just copied and pasted), but when I tried to add a student entry,i.e. ‘Add Student’ it givesBad Request The browser (or proxy) sent a request that this se…

Implement f-string like magic to pimp Djangos format_html()

I would like to pimp format_html() of Django. It already works quite nicely, but my IDE (PyCharm) thinks the variables are not used and paints them in light-gray color:AFAIK f-strings use some magic re…

Selecting a set of numbers from a list which add up to a given value [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 9…

List of even numbers at even number indexes using list comprehension [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 9…