Result of Get IssueType REST API call and issue types depicted on Jira UI has discrepancy
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
IssueType count on Jira cloud following steps: Settings > Issues > IssueType results less issue type count; while outcome of Rest API Get rest/api/2/issuetype gives more IssueType counts. Why there is a discrepancy in result from UI and API call.
環境
Jira Cloud
診断
Steps 1: Upon executing Rest API call request :
curl --location 'https://YOURINSTANCE.atlassian.net/rest/api/2/issuetype' \
--header 'Accept: application/json' \
--header 'Authorization: Basic aGRpeGl0QGF0bGFzc2lhbi5jb2XXXXXXXXXYX3pRUFhLeXEtY2VRVmE2NW5WaGZjVy1Lam1QNHhlVnpWcjdKOHZuSmRYdEljR3FaRTB2MVQ4Mk8yRklrSHh0S1VUakdCcTdNek5abDhQZXVTelJBU2tRMUNhdEYweUpSeVJpQTlrc1NUd2Y3eHVDVlJHMkXXXXXXaTNvPTM0QjE2MUQ0' \
--header 'Cookie: atlassian.xsrf.token=1278752e083db3d60b314cfXXXXXXXXf34e_lin'
The response is 85 IssueType. NOTE: Count could vary for your instance.
Step 2: Following steps below from Jira instance UI could notice ~ 45 IssueType(The count could be different in your instance)
Settings > Issues > IssueType
Step 3: Please check if your instance has Team managed projects in your site. If yes then navigate to one of the Team Managed project that holds custom IssueType following steps :
Go to Project settings > Issue Types , Copy the custom Issue Type
Step 4: Adhering Step 2 search the copied issue Type in Issue Type section of Issue,You would notice no result.
原因
Jira UI Issue Type section locate issue Type that could be utilized by Company managed projects, excluding Team managed Issue Type details. While API call Get rest/api/2/issuetype list down all the issue types on which user has access, which means that if the user holds access/permission to Team managed project that is Private/Public/Limited access, then they should be able to get the issue type of team managed projects with the help of given API call.
ソリューション
Depending on your use case you should choose which approach you would like to refer to locate issue type. Additionally you can utilize API call Get rest/api/3/project/{projectIdOrKey} to fetch issueType associated with individual project.