Jen Evenson
01/25/2022, 6:35 PMjira.exceptions.JIRAError: JiraError HTTP 400 url: <https://our_jira_url/rest/api/2/issue>
text: expected Object containing a 'name' property
response text = {"errorMessages":[],"errors":{"assignee":"expected Object containing a 'name' property"}}
options = {
"project": project_name,
"assignee": {"accountId": assignee},
"issuetype": {"name": issue_type},
"summary": summary,
"description": description,
}
Do others successfully use the JiraTask with Jira Server? Was the JiraTask maybe only intended to be used with Jira Cloud (api/3/issue) and not Jira Server (api/2/issue)?
I know that my company has one of the largest single-instance Jira applications in the world, and we have a bunch of customizations so I don't know if this is only an issue for us.
I've asked our internal Jira team if this particular issue might be related to a customization but haven't heard back yet.
If I add a 'name' property to the assignee object ("assignee": {"accountId": assignee, 'name': assignee},
), JiraTask will work and correctly create a Jira ticket. I obviously don't know if changing that in your codebase would break JiraTask for other users...
[2022-01-24 15:35:32+0000] ERROR - prefect.TaskRunner | Task 'JiraTask': Exception encountered during task execution!
Traceback (most recent call last):
File "~/.pyenv/versions/myvenv/site-packages/prefect/engine/task_runner.py", line 880, in get_task_run_state
logger=self.logger,
File "~/.pyenv/versions/myvenv/site-packages/prefect/utilities/executors.py", line 467, in run_task_with_timeout
return task.run(*args, **kwargs) # type: ignore
File "~/.pyenv/versions/myvenv/site-packages/prefect/utilities/tasks.py", line 456, in method
return run_method(self, *args, **kwargs)
File "~/.pyenv/versions/myvenv/site-packages/prefect/tasks/jira/jira_task.py", line 141, in run
created = jira.create_issue(options)
File "~/.pyenv/versions/myvenv/site-packages/jira/client.py", line 1448, in create_issue
r = <http://self._session.post|self._session.post>(url, data=json.dumps(data))
File "~/.pyenv/versions/myvenv/site-packages/jira/resilientsession.py", line 198, in post
return self.__verb("POST", str(url), data=data, json=json, **kwargs)
File "~/.pyenv/versions/myvenv/site-packages/jira/resilientsession.py", line 189, in __verb
raise_on_error(response, verb=verb, **kwargs)
File "~/.pyenv/versions/myvenv/site-packages/jira/resilientsession.py", line 70, in raise_on_error
**kwargs,
jira.exceptions.JIRAError: JiraError HTTP 400 url: <https://our_jira_url/rest/api/2/issue>
text: expected Object containing a 'name' property
response headers = {[snipped for corp privacy]}
response text = {"errorMessages":[],"errors":{"assignee":"expected Object containing a 'name' property"}}
Kevin Kho
01/25/2022, 6:44 PM