import requests import xml.etree.ElementTree as ET # cases to be updated bugs = [9,10,11] # api token api_token = '' # your subdomain subdomain = '' # custom field with the value you want to copy field_to_be_copied = '' # custom field where you want to paste the value copied field_to_copy_to = '' for bug in bugs: # url to get the field value url = 'https://{subdomain}.fogbugz.com/api.asp?&token={api_token}&cmd=viewCase&ixBug={bug_num}&cols=plugin_customfield'.format(subdomain=subdomain, api_token=api_token, bug_num=bug) response = ET.fromstring(requests.get(url).content) #parse the response and get the value result = response.findall(field_to_be_copied) custom_field_copied = str(response[0].find(field_to_be_copied).text) # update the desired field url = 'https://{subdomain}.fogbugz.com/api.asp?token={api_token}&cmd=edit&ixBug={bug_num}&{field_to_copy_to}={value}'.format(subdomain=subdomain, api_token=api_token, bug_num=bug, field_to_copy_to=field_to_copy_to, value=custom_field_copied) requests.post(url) print ("Finished")