Skip to content

Commit

Permalink
Made behaviour of create_issues consistent with create_issue (#1594)
Browse files Browse the repository at this point in the history
* fixes call to issue_type_by_name with missing project id

Co-authored-by: Gael Mainguet <gael.mainguet@voltatrucks.com>
  • Loading branch information
gmainguet and Gael Mainguet committed Feb 7, 2023
1 parent 7f91207 commit 35a7013
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,15 +1552,19 @@ def create_issues(
issue_data: Dict[str, Any] = _field_worker(field_dict)
p = issue_data["fields"]["project"]

project_id = None
if isinstance(p, (str, int)):
issue_data["fields"]["project"] = {"id": self.project(str(p)).id}
project_id = self.project(str(p)).id
issue_data["fields"]["project"] = {"id": project_id}

p = issue_data["fields"]["issuetype"]
if isinstance(p, int):
issue_data["fields"]["issuetype"] = {"id": p}
if isinstance(p, str):
elif isinstance(p, str):
issue_data["fields"]["issuetype"] = {
"id": self.issue_type_by_name(str(p)).id
"id": self.issue_type_by_name(
str(p), project=str(project_id) if project_id else None
).id
}

data["issueUpdates"].append(issue_data)
Expand Down

0 comments on commit 35a7013

Please sign in to comment.