首页 > 解决方案 > 无法转换脱颖而出

问题描述

从 JIRA rest API 导入字段到 excel 时,我经常遇到这个问题。

我的输出结果是

[None,
 None,
 None,
 None,
 <JIRA Resolution: name='Fixed', id='1'>,
 None,
 None,
 <JIRA Resolution: name='Fixed', id='1'>,
 None,
 None,
 None,
 <JIRA Resolution: name='Done', id='10000'>,
 <JIRA Resolution: name='Done', id='10000'>,
 <JIRA Resolution: name='Done', id='10000'>,
 <JIRA Resolution: name='Done', id='10000'>,

这是我下面的代码

res_list = []

issues_in_project = jira.search_issues('labels=team1', maxResults=False)


for issue in issues_in_project:
    res_list.append(issue.fields.resolution)

res_row = 2

for res in res_list:
    ws.cell(row=res_row, column=start_column+4).value = res
    res_row += 1 

错误是

    217         elif value is not None:
--> 218             raise ValueError("Cannot convert {0!r} to Excel".format(value))
    219 
    220         self._value = value

ValueError: Cannot convert <JIRA Resolution: name='Fixed', id='1'> to Excel

标签: pythonexcelerror-handlingopenpyxljira-rest-api

解决方案


推荐阅读