Как экспортировать комментарий JIRA - PullRequest
0 голосов
/ 18 января 2020

Я использую Python библиотеку JIRA для экспорта содержимого проекта. Большинство полей являются нормальными, за исключением комментариев. Ниже приведены мои коды, нужна помощь, чтобы указать, в чем заключается ошибка. Почему это выходит с ошибкой: Большое спасибо.

"Traceback (most recent call last):
    comments=item.fields.comment.comments
AttributeError: type object 'PropertyHolder' has no attribute 'comment'". 
from jira import JIRA
import pandas as pd
import openpyxl

jira = JIRA("http://jira-ep.ecp.priv")
block_size = 1000
block_num = 0
allissues = []

while True:
    start_idx = block_num * block_size
    issues = jira.search_issues(
        'project=PRJ0404 and type=DFM',
        start_idx,
        block_size
    )

    if len(issues) == 0:
        break

    block_num += 1

    for issue in issues:
        allissues.append(issue)

dfm = pd.DataFrame()

for item in allissues:
    d = {
        'key': item.key,
        'PCB': item.fields.customfield_10424,
        'Summary': item.fields.summary,
        'Severity': item.fields.customfield_10323,
        'Description': item.fields.description,
        'Reporter': item.fields.reporter,
        'Assignee': item.fields.assignee,
        'Create Stage': item.fields.customfield_10324,
        'Created Date': item.fields.created[0:10],
        'Updated Date': item.fields.updated[0:10],
        'Status': item.fields.status,
    }
    solution = ""
    comments = item.fields.comment.comments
    for comment in comments: # Get DFM comment filed content
        solution = comment.created[0:10] + 
            " " + 
            str(comment.author.name) + 
            ": " + 
            comment.body
    d = {'Solution': solution}
    dfm = dfm.append(d, ignore_index=True)
...