mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Merge 65c2bf6d42
into 3cd34b5af6
This commit is contained in:
commit
a93351db84
|
@ -24,48 +24,43 @@ export const description = updateDisplayOptions(displayOptions, properties);
|
||||||
export async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {
|
export async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {
|
||||||
let responseData: IDataObject | IDataObject[] = [];
|
let responseData: IDataObject | IDataObject[] = [];
|
||||||
|
|
||||||
const observableId = this.getNodeParameter('id', i);
|
const observableId = this.getNodeParameter('id', i, '', {
|
||||||
|
extractValue: true,
|
||||||
|
}) as string;
|
||||||
const responderId = this.getNodeParameter('responder', i) as string;
|
const responderId = this.getNodeParameter('responder', i) as string;
|
||||||
let body: IDataObject;
|
let body: IDataObject;
|
||||||
let response;
|
|
||||||
responseData = [];
|
responseData = [];
|
||||||
body = {
|
body = {
|
||||||
responderId,
|
responderId,
|
||||||
objectId: observableId,
|
objectId: observableId,
|
||||||
objectType: 'case_artifact',
|
objectType: 'case_artifact',
|
||||||
};
|
};
|
||||||
response = await theHiveApiRequest.call(this, 'POST', '/connector/cortex/action' as string, body);
|
const response = await theHiveApiRequest.call(
|
||||||
body = {
|
this,
|
||||||
query: [
|
'POST',
|
||||||
{
|
'/connector/cortex/action' as string,
|
||||||
_name: 'listAction',
|
body,
|
||||||
},
|
);
|
||||||
{
|
body = {};
|
||||||
_name: 'filter',
|
|
||||||
_and: [
|
|
||||||
{
|
|
||||||
_field: 'cortexId',
|
|
||||||
_value: response.cortexId,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
_field: 'objectId',
|
|
||||||
_value: response.objectId,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
_field: 'startDate',
|
|
||||||
_value: response.startDate,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
const qs: IDataObject = {};
|
const qs: IDataObject = {};
|
||||||
qs.name = 'log-actions';
|
qs.name = 'log-actions';
|
||||||
|
let observableAction;
|
||||||
do {
|
do {
|
||||||
response = await theHiveApiRequest.call(this, 'POST', '/v1/query', body, qs);
|
observableAction = await theHiveApiRequest.call(
|
||||||
} while (response.status === 'Waiting' || response.status === 'InProgress');
|
this,
|
||||||
|
'GET',
|
||||||
|
`/connector/cortex/action/case_artifact/${observableId}`,
|
||||||
|
body,
|
||||||
|
qs,
|
||||||
|
);
|
||||||
|
|
||||||
responseData = response;
|
observableAction = observableAction.find(
|
||||||
|
(action: any) => action._createdAt == response._createdAt,
|
||||||
|
);
|
||||||
|
} while (observableAction.status === 'Waiting' || observableAction.status === 'InProgress');
|
||||||
|
|
||||||
|
responseData = observableAction;
|
||||||
|
|
||||||
const executionData = this.helpers.constructExecutionMetaData(wrapData(responseData), {
|
const executionData = this.helpers.constructExecutionMetaData(wrapData(responseData), {
|
||||||
itemData: { item: i },
|
itemData: { item: i },
|
||||||
|
|
|
@ -36,7 +36,7 @@ export const responderOptions: INodeProperties = {
|
||||||
required: true,
|
required: true,
|
||||||
default: '',
|
default: '',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsDependsOn: ['id', 'id.value'],
|
loadOptionsDependsOn: ['id.value'],
|
||||||
loadOptionsMethod: 'loadResponders',
|
loadOptionsMethod: 'loadResponders',
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
|
Loading…
Reference in a new issue