Jira Python:尝试打印时出现语法错误 [英] Jira Python: Syntax error appears when trying to print

查看:169
本文介绍了Jira Python:尝试打印时出现语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

from jira.client import jira

options = {'server': 'https://URL.com'}
jira = JIRA(options, basic_auth=('username', 'password'))

issues = jira.search_issues('jqlquery')
for issue in issues:
    print issue

我想打印jql查询的输出.但是,最后一行"issue"上出现语法错误.

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

推荐答案

将问题密钥打印到命令提示符的方法是:

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

from jira.client import jira

options = {'server': 'https://URL.com'}
jira = JIRA(options, basic_auth=('username', 'password'))

issues = jira.search_issues('jqlquery')
for issue in issues:
    print issue

那样就可以了.但是,您提到您在JQL查询中遇到语法错误,因此您需要发布该查询以查看问题所在.例如,如果您想查找在上一个问题中添加了标签"TEST"的问题,那么该记录将有效:

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))

或者:

jqlquery = 'labels=TEST'
issues = jira.search_issues(jqlquery)

这篇关于Jira Python:尝试打印时出现语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆