所以这段代码以前有效,现在我得到了一个JSON错误。我在google上搜索了修正的日期时间和json.dump文件但我想不出办法。当没有直接的日期变量时,我不确定如何在代码中实现。在
from jira import JIRA
import pandas as pd
df = pd.read_excel('JIRA.xlsx', header=0, index=False).dropna(how='all')
options = {'server': 'https://act.genpt.net'}
jira_user = input('User Name: ')
jira_password = input('Password: ')
jira = JIRA(options, basic_auth=(jira_user, jira_password))
for index, row in df.iterrows():
summary = row[2]
description = 'Research and assign attributes'
owner = row[3]
dueDate = row[4]
issue_dict = {
'project': 11208,
'issuetype': {'name': 'Task'},
'summary': summary,
'priority': {'id': '7'},
'description': description,
'environment': 'PROD',
'components': 'Item Type Clean Up',
'customfield_10108': owner,
'duedate': dueDate
}
new = jira.create_issue(fields=issue_dict)
pandas.datetime
对象,如datetime.datetime
对象,不可json
序列化,并将导致这些错误。解决此问题的最佳方法是使用字符串格式设置日期时间,因为字符串是可散列的:位于here的文档
相关问题 更多 >
编程相关推荐