i am quiet lost currently.
i want to load some data from my sqlite3 db and then create from this data some acceptance criteria and update the respective issue with these acc.
The issue i have is that i dont understand where my problem is regarding the "build" of the list element that contains the data for the acceptance criteria
i iterate over the data i did load from my DB to create a string variable.
for entry in accDict:
strAcc = (
strAcc
+ '{"name":'
+ entry["NAME"]
+ ',"checked": False,"Mandatory":'
+ entry["MANDATORY"]
+ ',"option": False,"id":'
+ str(cnt_id)
+ ',"rank": '
+ str(cnt_rank)
+ ",} "
)
cnt_id += 1
cnt_rank += 1
strAcc = "[{" + strAcc + "}]"
next i want to insert this string and update the customfields for the respective issue.
new_issue.update(fields={"customfield_11100": [strAcc]})
the code in strAcc looks as follows
[{
{"name":Create Testcases,"checked": False,"Mandatory":True,"option": False,"id":1,"rank": 0,},
{"name":Request Testdata,"checked": False,"Mandatory":True,"option": False,"id":2,"rank": 1,},
{"name":Verify Testressources,"checked": False,"Mandatory":True,"option": False,"id":3,"rank": 2,},
}]
this means the complete insert looks as this
new_issue.update(fields={"customfield_11100":[{
{"name":Create Testcases,"checked": False,"Mandatory":True,"option": False,"id":1,"rank": 0,},
{"name":Request Testdata,"checked": False,"Mandatory":True,"option": False,"id":2,"rank": 1,},
{"name":Verify Testressources,"checked": False,"Mandatory":True,"option": False,"id":3,"rank": 2,},
}]})
the error i receive is
response text = {"errorMessages":["Internal server error"],"errors":{}}
if i create the string by hand and place it as in the last code block it works perfectly...
question from:
https://stackoverflow.com/questions/65643998/inserting-dynamic-acceptance-criteria-into-customfield-via-python