Fix loading of projects for hosted Jira

This commit is contained in:
Jan Oberhauser 2020-05-04 19:35:02 +02:00
parent 1a63af460a
commit 98ac9d93bc
2 changed files with 6 additions and 2 deletions

View file

@ -81,6 +81,9 @@ export const issueFields = [
},
typeOptions: {
loadOptionsMethod: 'getProjects',
loadOptionsDependsOn: [
'jiraVersion',
],
},
description: 'Project',
},

View file

@ -111,9 +111,10 @@ export class JiraSoftwareCloud implements INodeType {
// select them easily
async getProjects(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const jiraCloudCredentials = this.getCredentials('jiraSoftwareCloudApi');
const jiraVersion = this.getCurrentNodeParameter('jiraVersion') as string;
let endpoint = '/project/search';
if (jiraCloudCredentials === undefined) {
if (jiraVersion === 'server') {
endpoint = '/project';
}
let projects = await jiraSoftwareCloudApiRequest.call(this, endpoint, 'GET');