Skip to content

Commit

Permalink
Jira Server/DataCenter: Update meta methods (#9512)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch authored Feb 12, 2024
1 parent 57bd056 commit 00db247
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dojo/jira_link/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,28 +1036,28 @@ def get_issuetype_fields(

else:
try:
issuetypes = jira.createmeta_issuetypes(project_key)
issuetypes = jira.project_issue_types(project_key)
except JIRAError as e:
e.text = f"Jira API call 'createmeta/issuetypes' failed with status: {e.status_code} and message: {e.text}. Project misconfigured or no permissions in Jira ?"
raise e

issuetype_id = None
for it in issuetypes['values']:
if it['name'] == issuetype_name:
issuetype_id = it['id']
for it in issuetypes:
if it.name == issuetype_name:
issuetype_id = it.id
break

if not issuetype_id:
raise JIRAError("Issue type ID can not be matched. Misconfigured default issue type ?")

try:
issuetype_fields = jira.createmeta_fieldtypes(project_key, issuetype_id)
issuetype_fields = jira.project_issue_fields(project_key, issuetype_id)
except JIRAError as e:
e.text = f"Jira API call 'createmeta/fieldtypes' failed with status: {e.status_code} and message: {e.text}. Misconfigured project or default issue type ?"
raise e

try:
issuetype_fields = [f['fieldId'] for f in issuetype_fields['values']]
issuetype_fields = [f.fieldId for f in issuetype_fields]
except Exception:
raise JIRAError("Misconfigured default issue type ?")

Expand Down

0 comments on commit 00db247

Please sign in to comment.