I am trying to set the labels field for a JIRA ticket in Python using the jira-python API.
With a valid JIRA issue object, created with issue = jira.issue(jira_ticket)
, I have tried the following:
issue.update(labels='AAA')
: gives anot on the appropriate screen
error as below.issue.update(fields={'labels':'AAA'})
: also gives anot on the appropriate screen
error as below.issue.fields.labels.append(u'AAA')
: does not produce an error, but does not update field. I guess it updates the issue object, but doesn't push back to JIRA server.
I seem to always receive the error:
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://someserver/rest/api/2/issue/nnnnnn
text: Field 'labels' cannot be set. It is not on the appropriate screen, or unknown.
This is the same error as this post, Python - JIRA - Modify Labels, but for different reasons - namely, labels are not turned off here, and I can set them with the web interface: See Image: JIRA Labels Added in Web UI and Image: updated JIRA issue with Labels.
If I dump out the raw fields for the issue in question, having added labels to it using the Web UI as above, then I can see the labels in the Python JIRA Issue object:
Field: 'labels', Value: ['StackOverflow', 'TAGTHATICANSEARCHFOR']
If anyone can point me in the right direction, it would be greatly appreciated.