I have a JIRA Ticket where I am trying to update the field of "Verified Version:" of the Ticket to something like "ABC 1.0"
The REST API name for "Verified Version:" is "customfield_11361".
When updated the version manually, it looks like below:
"customfield_11361": [
{
"self": <API_URL>,
"id": "104743",
"description": "",
"name": "ABC 1.0",
"archived": false,
"released": false,
"releaseDate": "2022-07-31"
}
]When not version is updated, it looks like below:
"customfield_11361": [
] When tried from python interpreter, I get the following results.
>>> from jira import JIRA
>>> headers = {}
>>> headers["Authorization"] = "Bearer <Token_key>"
>>> jira_obj = JIRA(server=<JIRA_Server_URL>, options={"headers":headers})
>>> jira_obj.issue(<JIRA_Ticket>)
<JIRA Issue: key=u'<JIRA_Ticket>', id=u'1247768'>
>>> jira_obj.issue(<JIRA_Ticket>).fields.customfield_11361
[<JIRA Version: name=u'ABC 1.0', id=u'104743'>]
>>> jira_obj.issue(<JIRA_Ticket>).fields.customfield_11361[0]
<JIRA Version: name=u'ABC 1.0', id=u'104743'>
...
Cleared the verified version manually in the JIRA Ticket directly.
...
>>> jira_obj.issue(<JIRA_Ticket>).fields.customfield_11361
[]
>>> jira_obj.issue(<JIRA_Ticket>).update({'customfield_11361': [{'name': 'ABC 1.0'}]})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/naveen.shankar/auto_validator/my_nutest_virtual_env/lib/python2.7/site-packages/jira/resources.py", line 412, in update
super(Issue, self).update(async=async, jira=jira, fields=data)
File "/home/naveen.shankar/auto_validator/my_nutest_virtual_env/lib/python2.7/site-packages/jira/resources.py", line 178, in update
self.self, data=data)
File "/home/naveen.shankar/auto_validator/my_nutest_virtual_env/lib/python2.7/site-packages/jira/resilientsession.py", line 136, in put
return self.__verb('PUT', url, **kwargs)
File "/home/naveen.shankar/auto_validator/my_nutest_virtual_env/lib/python2.7/site-packages/jira/resilientsession.py", line 126, in __verb
raise_on_error(response, verb=verb, **kwargs)
File "/home/naveen.shankar/auto_validator/my_nutest_virtual_env/lib/python2.7/site-packages/jira/resilientsession.py", line 45, in raise_on_error
r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 415
url: <API_URL>
response headers = {'X-ANODEID': 'JiraProd_i-0ff79dea69bc39a25_10.150.20.84', 'X-AUSERNAME': 'svc.eng.jirautotriag', 'Content-Length': '0', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Set-Cookie': 'AWSALBTG=30RQv3GKZcjCtYxL2RGbsbH8yLx1ey8ma64o2iaAZUA/7Nm/r5cAGQ0FmfvnzKLZt8SMshr7J6+dF6pRrFR2p608sS2pmYoHoevjiesIvqEi5AY0Xnvxe93mePiHpM6nN55WMTqV9CkTC0opuuQVnp+c/UZ2ZYnyONCEiuiFOQ7grK1nmn8=; Expires=Sun, 25 Sep 2022 06:28:00 GMT; Path=/, AWSALBTGCORS=30RQv3GKZcjCtYxL2RGbsbH8yLx1ey8ma64o2iaAZUA/7Nm/r5cAGQ0FmfvnzKLZt8SMshr7J6+dF6pRrFR2p608sS2pmYoHoevjiesIvqEi5AY0Xnvxe93mePiHpM6nN55WMTqV9CkTC0opuuQVnp+c/UZ2ZYnyONCEiuiFOQ7grK1nmn8=; Expires=Sun, 25 Sep 2022 06:28:00 GMT; Path=/; SameSite=None; Secure, JSESSIONID=93EB48BE1E6601CA9D0F5F1B2065C062; Path=/; Secure; HttpOnly, atlassian.xsrf.token=B14E-GL73-6FKZ-OP3B_a78d88ea0c35e582f026ada3d9f98b6ece47285f_lin; Path=/; Secure, AWSALBAPP-0=AAAAAAAAAAA3k++saeQ+htH2m7IzGNyst8sx9HUMRQ3aJCFVRuxgIlV4QIoLMgM32mgmZI+o0hsK93RUPAeVl2tzJpmfjup20SVnealEWGbmqDdtpdatO6rxxsLx+H1qYI19avkc0Xbxkss=; Expires=Sun, 25 Sep 2022 06:28:00 GMT; Path=/, AWSALBAPP-1=_remove_; Expires=Sun, 25 Sep 2022 06:28:00 GMT; Path=/, AWSALBAPP-2=_remove_; Expires=Sun, 25 Sep 2022 06:28:00 GMT; Path=/, AWSALBAPP-3=_remove_; Expires=Sun, 25 Sep 2022 06:28:00 GMT; Path=/', 'X-Seraph-LoginReason': 'OK', 'Strict-Transport-Security': 'max-age=31536000', 'X-AREQUESTID': '388x3995248x3', 'X-ASESSIONID': '1nq6mq5', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Sun, 18 Sep 2022 06:28:00 GMT', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Content-Type': 'text/html;charset=UTF-8'}
response text =The HTTP 415 means "the server refuses to accept the request because the payload format is in an unsupported format." in general.
Any suggestions as to properly form the date in order to update?
I have removed the confidential JIRA URLs, Access Token, etc... for security reasons. I hope that is fine.
Please assist. Thanks in Advance.