을 작성했습니다. JIRA에서 문제를 삭제하고 생성하는 프로세스를 자동화하는 REST API의 확장 인 JIRA Python 모듈을 사용하고 있습니다. JIRA에서 다른 데이터베이스에서 수집 한 가져온 데이터를 사용하는 Python 스크립트에서 'for'루프를 사용하여 문제를 만들려고합니다. 내가 만든 데이터가 JIRA의 해당 필드와 올바르게 정렬되도록 문제를 생성 할 때 필드의 형식을 지정해야합니다. 내 파이썬 코드는 이슈를 생성하고 사용자 정의 변수에 저장되는 JIRA에 데이터를 저장하기 위해 아래에 있습니다.Python REST API를 사용하여 JIRA에서
df에는 새로운 문제점을 생성하여 JIRA에 입력하려는 13 개의 데이터 열이 들어 있습니다. 각 컬럼은 JIRA에서 발행되는 다른 필드를 나타냅니다. JIRA에서 만든 모든 새로운 문제는 각 열에서 정보를 얻어야한다 : 여기
JIRAError: HTTP 400: "{u'cqid': u"Field 'cqid' cannot be set. It is not on the appropriate screen, or unknown.", u'wistate': u"Field 'wistate' cannot be set. It is not on the appropriate screen, or unknown.", u'dateresolved': u"Field 'dateresolved' cannot be set. It is not on the appropriate screen, or unknown.", u'res': u"Field 'res' cannot be set. It is not on the appropriate screen, or unknown.", u'datecreated': u"Field 'datecreated' cannot be set. It is not on the appropriate screen, or unknown.", u'affected': u"Field 'affected' cannot be set. It is not on the appropriate screen, or unknown.", u'fixed': u"Field 'fixed' cannot be set. It is not on the appropriate screen, or unknown."}"
가에서 만든 모든 단일 문제에 대한 JIRA에 표시되는 몇 가지 예를 들어 데이터입니다 :
from jira.client import JIRA
import pandas as pd
# Now we input the issues from the export.csv CSV file into the fields
# of new issues that are being created in JIRA to replace the old ones that were
# deleted
df = pd.read_csv('C:\\Python27\\scripts\\export.csv')
# Set the column names from the export.csv file equal to variables using the
# pandas python module
# Now do the actual loop to create new issues
for row in df:
cqid = df['ClearQuest ID']
summ = str(df.Summary)
datecreated = df['Date Created']
dateresolved = df['Date Resolved']
wistate = df['WI State']
res = df.Resolution
affected = df['Affected version/s']
fixed = df['Fix version/s']
issue_type = df['Issue Type']
priority = df.Priority
comments = str(df.Comments)
jira.create_issue(project={'key': 'DEL'}, wistate={'customfield_1001': 'WI State'}, res={'customfield_1001': 'Resolution'}, cqid={'customfield_1001': 'ClearQuest ID'}, datecreated={'customfield_1001': 'Date Created'}, dateresolved={'customfield_1001': 'Date Resolved'}, priority={'customfield_1001': 'Priority'}, fixed={'customfield_1001': 'Fixed Version'}, affected={'customfield_10004': 'affected'}, summary=summ, description=comments, issuetype={'name': 'Defect'})
그것은 오류를 제공합니다 코멘트 필드 :
문제 1 :
0 NaN이는
1 ... 델타는 패킷 수신부 누출 것을 찾을 수
2 T 그는 델타 항공은
6시 ... 생물 의학 메뉴, 일을 통해 IDS를 업그레이드하면 연결을 끊을 때마다 ... CP는 리터에 걸리는 때 기록받을하기로했다
4
3 NaN이 ...
5 재설정됩니다
9 재확인 구축하여 ...
8 퓨전 힙 사이즈 및 SCC1 Initia 증가 ... 생물 의학 메뉴 번째 통해 IDS 업그레이드되는
7 ... 생물 의학 메뉴 번째 통해 IDS 업그레이드 142+ , 매트가 배달 한 후에 ...
10 WPA2를 사용할 때 EAPOL 키 교환이 있습니다 ...
11 WPA2를 사용하는 경우 EA 키 echange 가고 POL ...
12 NaN의
13 NaN의
14 NaN의 ...
문제 1 :
문제 2 : 델타는 패킷 수신부 누출 것을 찾을 수 ...
문제 3 : 델타는 연결을 끊을 때마다 ... 재설정됩니다 ...
시도''()''여기를 참조 : http://pandas.pydata.org/pandas-docs/dev/basics.html#iteration 그것은 작동하지 않았다 – Jeff
불행히도, 오류가 발생했습니다 : AttributeError : 'DataFrame'객체에 'itertrows'속성이 없습니다. 필자는 pander import part가 작동하는 jira.create_issue 부분이라고 생각합니다. – JMan
typo! ''df.iterrows()'' – Jeff