-
-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues.update(labels=[]) fails with JIRAError #226
Comments
This issue is valid. Please remove below from documentation. it will give an error like
|
I am also seeing errors given the first method, and also for the second method: issue.fields.labels.append(u'LABEL1')
issue.update(fields={"labels": issue.fields.labels}) yielding: JIRAErrorTraceback (most recent call last)
<ipython-input-73-3251eb23d1f9> in <module>()
1 issue.fields.labels.append(u'LABEL1')
----> 2 issue.update(fields={"labels": issue.fields.labels})
/home/soc-monitor/anaconda2/lib/python2.7/site-packages/jira/resources.pyc in update(self, fields, update, async, jira, notify, **fieldargs)
478 fields_dict[field] = value
479
--> 480 super(Issue, self).update(async=async, jira=jira, notify=notify, fields=data)
481
482 def add_field_value(self, field, value):
/home/soc-monitor/anaconda2/lib/python2.7/site-packages/jira/resources.pyc in update(self, fields, async, jira, notify, **kwargs)
227
228 r = self._session.put(
--> 229 self.self + querystring, data=data)
230 if 'autofix' in self._options and \
231 r.status_code == 400:
/home/soc-monitor/anaconda2/lib/python2.7/site-packages/jira/resilientsession.pyc in put(self, url, **kwargs)
154
155 def put(self, url, **kwargs):
--> 156 return self.__verb('PUT', url, **kwargs)
157
158 def delete(self, url, **kwargs):
/home/soc-monitor/anaconda2/lib/python2.7/site-packages/jira/resilientsession.pyc in __verb(self, verb, url, retry_data, **kwargs)
144 if exception is not None:
145 raise exception
--> 146 raise_on_error(response, verb=verb, **kwargs)
147 return response
148
/home/soc-monitor/anaconda2/lib/python2.7/site-packages/jira/resilientsession.pyc in raise_on_error(r, verb, **kwargs)
54 error = r.text
55 raise JIRAError(
---> 56 r.status_code, error, r.url, request=request, response=r, **kwargs)
57 # for debugging weird errors on CI
58 if r.status_code not in [200, 201, 202, 204]:
JIRAError: JiraError HTTP 400 url: https://itjira.company.com/rest/api/2/issue/559504
text: Field 'labels' cannot be set. It is not on the appropriate screen, or unknown.
response headers = {'X-AUSERNAME': 'test-user, 'X-AREQUESTID': '447x3678045x2', 'X-Content-Type-Options': 'nosniff', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'X-ASESSIONID': 'klp8t6', 'Server': 'Apache', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Thu, 20 Jul 2017 12:27:05 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'X-ASEN': 'SEN-2208072'}
response text = {"errorMessages":[],"errors":{"labels":"Field 'labels' cannot be set. It is not on the appropriate screen, or unknown."}} |
Confirmed. I also had the error using the first method ( |
Hi any idea how to resolve this? |
This works: Submitting a docs PR to correct the bad example |
labels must be encapsulated in fields arg close #226
When attempting to update labels using the example from https://pythonhosted.org/jira/ a JIRAError and stacktrace are returned.
When I use the second option
All works, and this applies to a issue that currently has labels = None
The text was updated successfully, but these errors were encountered: