mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Linear Node): Fix issue with Issue States not loading correctly (#5435)
This commit is contained in:
committed by
GitHub
parent
32de081b0c
commit
57a2b9cceb
@@ -134,11 +134,38 @@ export class Linear implements INodeType {
|
||||
return returnData;
|
||||
},
|
||||
async getStates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
let teamId = this.getNodeParameter('teamId', null) as string;
|
||||
// Handle Updates
|
||||
if (!teamId) {
|
||||
const updateFields = this.getNodeParameter('updateFields', null) as IDataObject;
|
||||
// If not updating the team look up the current team
|
||||
if (!updateFields.teamId) {
|
||||
const issueId = this.getNodeParameter('issueId');
|
||||
const body = {
|
||||
query: query.getIssueTeam(),
|
||||
variables: {
|
||||
issueId,
|
||||
},
|
||||
};
|
||||
const responseData = await linearApiRequest.call(this, body);
|
||||
teamId = responseData?.data?.issue?.team?.id;
|
||||
} else {
|
||||
teamId = updateFields.teamId as string;
|
||||
}
|
||||
}
|
||||
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const body = {
|
||||
query: query.getStates(),
|
||||
variables: {
|
||||
$first: 10,
|
||||
filter: {
|
||||
team: {
|
||||
id: {
|
||||
eq: teamId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
const states = await linearApiRequestAllItems.call(this, 'data.workflowStates', body);
|
||||
|
||||
Reference in New Issue
Block a user