import requests
import xml.etree.ElementTree as ET

# cases to be updated
bugs = [9,10,11]

# api token
api_token = '<your-API-token>'

# your subdomain 
subdomain = '<your-subdomain>'

# custom field with the value you want to copy
field_to_be_copied = '<Field-to-be-copied>'

# custom field where you want to paste the value copied
field_to_copy_to = '<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")