Have the following method to pull data from a csv to write create a Jira issue. I first create issue with Summary and Description. I then want to update the issue to include the Feature ID field(type is label). I also want to update the Labels field with "tags" column from the csv.(importing from Rally csv into Jira)
Does featureid need to be converted to a list, then passed into the update?
for row in df2.iterrows():
summ = str(df2.loc[row[0], 'Summary'])
desc = str(df2.loc[row[0], 'Description'])
#These have to be updated
featureid = str(df2.loc[row[0], 'Feature ID'])# customfield_10007, type is label
#owner = str(df2.loc[row[0], 'Assignee']) # need to update usernames or have a lookup
tags = str(df2.loc[row[0], 'Labels']) # Needs to return an array
try:
jira_options = {'server': jira_url}
jira = JIRA(options=jira_options, basic_auth=(jira_user, jira_password))
log.info("Connecting to JIRA: %s" % jira_url)
#customfield_10007=featureid, assignee=owner, description=desc, labels=tags,
issue = jira.create_issue(project={'key': jira_project_key},
summary = summ,
description = desc,
issuetype = {'name': jira_issue_type})
print issue ,'was created.'
issue.update(customfield_10007={'Feature ID':featureid}) #need to convert to list before I can update?
except JIRAError, e:
log.error("Failed to connect to JIRA: %s" % e)
print "Failed to connect to JIRA ",e
return None