mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
⚡ Fix loading of projects for hosted Jira
This commit is contained in:
@@ -81,6 +81,9 @@ export const issueFields = [
|
|||||||
},
|
},
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getProjects',
|
loadOptionsMethod: 'getProjects',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'jiraVersion',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
description: 'Project',
|
description: 'Project',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -111,9 +111,10 @@ export class JiraSoftwareCloud implements INodeType {
|
|||||||
// select them easily
|
// select them easily
|
||||||
async getProjects(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getProjects(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const jiraCloudCredentials = this.getCredentials('jiraSoftwareCloudApi');
|
const jiraVersion = this.getCurrentNodeParameter('jiraVersion') as string;
|
||||||
|
|
||||||
let endpoint = '/project/search';
|
let endpoint = '/project/search';
|
||||||
if (jiraCloudCredentials === undefined) {
|
if (jiraVersion === 'server') {
|
||||||
endpoint = '/project';
|
endpoint = '/project';
|
||||||
}
|
}
|
||||||
let projects = await jiraSoftwareCloudApiRequest.call(this, endpoint, 'GET');
|
let projects = await jiraSoftwareCloudApiRequest.call(this, endpoint, 'GET');
|
||||||
|
|||||||
Reference in New Issue
Block a user