Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Response Ops][Connectors] Refactor Jira Connector to use latest API …
…only (#197787) ## Summary Jira Cloud and Datacenter work using the same API urls. In this PR we remove the calls to the capabilities API which was being used to know the API url we needed to hit To test it: - Create Jira Cloud and Datacenter connectors - Test all use cases related to them Related to #189017 ## Research Work **getCapabilities, createIncident and getIncident** are always the same, therefore ignored for the rest of this document - getCapabilities: `/rest/capabilities` - createIncident: `/rest/api/2/issue` - getIncident: `/rest/api/2/issue` ## API links - Cloud: https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#version - DC: https://docs.atlassian.com/software/jira/docs/api/REST/9.17.0/ ### Expected API urls based on the API links - Get issue types - Cloud: `GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes` - DC:`GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes` - Get fields by issue type - Cloud: `GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}` - DC: `GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}` ### API we hit - Get issue types - Cloud `GET /rest/api/2/issue/createmeta?projectKeys=ROC&expand=projects.issuetypes.fields` (variable name we are using is `getIssueTypesOldAPIURL`) - DC `GET /rest/api/2/issue/createmeta/RES/issuetypes` (variable name is `getIssueTypesUrl`) - Get fields by issue type - Cloud `GET /rest/api/2/issue/createmeta?projectKeys=ROC&issuetypeIds={issueTypeId}&expand=projects.issuetypes.fields` (variable name is `getIssueTypeFieldsOldAPIURL`) - DC `GET /rest/api/2/issue/createmeta/RES/issuetypes/{issueTypeId}` (variable name is `getIssueTypeFieldsUrl`) #### Analysed use cases to retrieve API urls we hit - created a case with JIRA Cloud as Connector - did a connector test with JIRA Cloud as connector - created a case with JIRA DC as connector - did a connector test with JIRA DC as connector ### Conclusions - We are not using the right endpoints for Cloud, we should update them to use the same endpoints. --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Christos Nasikas <[email protected]> Co-authored-by: adcoelho <[email protected]> Co-authored-by: Antonio <[email protected]> Co-authored-by: Lisa Cawley <[email protected]>
- Loading branch information