0

I'm trying to read and update some fields based on issue number and field name from csv file.

Currently I've hard-coded the names and it looks like this

from jira import JIRA
import csv

later i read csv file in which column 0 is issue number and column 1 is field name/ID

issue,fieldid
TEST-1,customfield_XXXX
    csv_reader = csv.reader(csv_file, delimiter=',')
    line_count = 0

and in for loop i read issue by issue

issue = jira.issue(f'{row[0]}')

and update field

issue.update(fields={f'{row[1]}': issue.fields.customfield_XXXX + 'additionall text'})

in the last step I'd like to change issue.fields.customfield_XXXX to be generated based on the second column of the csv file row[1] Something like issue.fields.row[1]

Any tips on how I can accomplish this?

0 Answers0