I have created a new custom field to introduce form controls for better operational measurability, however, i want to map all existing label values to the new field "allocation". There are several thousand issues I need to update and was trying to test on this one ticket.
My Code:
from jira import JIRA
issue = jira.issue('Project1-1855')
allocation_field = issue.fields.customfield_16542.value
existinglabel_field = issue.fields.labels
existinglabel_field_string = str(existinglabel_field[0])
print ('want to change this...'
, allocation_field
,'to this...'
, issue.fields.labels[0]
)
#Set New Allocation Value
issue.update(fields={allocation_field: {'name': existinglabel_field_string}})
print ('The allocation field value of:'
, allocation_field
, 'has been changed to:'
, issue.fields.labels)
The error code i am getting is :
JIRAError: JiraError HTTP 400 url: https://ourcompany.jira.com/rest/api/2/issue/141717
text: Field 'NewAllocationField' cannot be set. It is not on the appropriate screen, or unknown.
This custom field is associated to all the different screens, screen schemes, and issue type screen schemes in the project. I know this because I can see the field when I naviagate to https://ourcompany.jira.com/secure/admin/ConfigureFieldScreen.jspa?id=XXX Can someone please advise?