2020-04-06 16:11:50 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-01-06 16:52:37 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const conditionFields: INodeProperties[] = [
|
2020-01-06 16:52:37 -08:00
|
|
|
{
|
|
|
|
displayName: 'Resource',
|
|
|
|
name: 'resource',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-01-06 16:52:37 -08:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Ticket',
|
|
|
|
value: 'ticket',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'ticket',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Field',
|
|
|
|
name: 'field',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
'resource': [
|
2020-10-22 06:46:03 -07:00
|
|
|
'ticket',
|
|
|
|
],
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Assignee',
|
|
|
|
value: 'assignee',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Group',
|
|
|
|
value: 'group',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Priority',
|
|
|
|
value: 'priority',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Status',
|
|
|
|
value: 'status',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Type',
|
|
|
|
value: 'type',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'status',
|
|
|
|
},
|
2022-05-20 14:47:24 -07:00
|
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-operation-without-no-data-expression
|
2020-01-06 16:52:37 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Changed',
|
|
|
|
value: 'changed',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Changed From',
|
|
|
|
value: 'value_previous',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Changed To',
|
|
|
|
value: 'value',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Greater Than',
|
|
|
|
value: 'greater_than',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Is',
|
|
|
|
value: 'is',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Is Not',
|
|
|
|
value: 'is_not',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Less Than',
|
|
|
|
value: 'less_than',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed',
|
|
|
|
value: 'not_changed',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed From',
|
|
|
|
value: 'not_value_previous',
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'Not Changed To',
|
|
|
|
value: 'not_value',
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
hide: {
|
|
|
|
field: [
|
|
|
|
'assignee',
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
default: 'is',
|
|
|
|
},
|
2022-05-20 14:47:24 -07:00
|
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-operation-without-no-data-expression
|
2020-01-06 16:52:37 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Changed',
|
|
|
|
value: 'changed',
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'Changed From',
|
|
|
|
value: 'value_previous',
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
{
|
|
|
|
name: 'Changed To',
|
|
|
|
value: 'value',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Is',
|
|
|
|
value: 'is',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Is Not',
|
|
|
|
value: 'is_not',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed',
|
|
|
|
value: 'not_changed',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed From',
|
|
|
|
value: 'not_value_previous',
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'Not Changed To',
|
|
|
|
value: 'not_value',
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
field: [
|
|
|
|
'assignee',
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
default: 'is',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
field: [
|
2020-10-22 06:46:03 -07:00
|
|
|
'status',
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
hide: {
|
|
|
|
operation:[
|
|
|
|
'changed',
|
|
|
|
'not_changed',
|
|
|
|
],
|
|
|
|
field: [
|
|
|
|
'assignee',
|
|
|
|
'group',
|
|
|
|
'priority',
|
|
|
|
'type',
|
|
|
|
],
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Closed',
|
|
|
|
value: 'closed',
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'New',
|
|
|
|
value: 'new',
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'Open',
|
|
|
|
value: 'open',
|
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
{
|
|
|
|
name: 'Pending',
|
|
|
|
value: 'pending',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Solved',
|
|
|
|
value: 'solved',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'open',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
field: [
|
2020-10-22 06:46:03 -07:00
|
|
|
'type',
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
hide: {
|
|
|
|
operation:[
|
|
|
|
'changed',
|
|
|
|
'not_changed',
|
|
|
|
],
|
|
|
|
field: [
|
|
|
|
'assignee',
|
|
|
|
'group',
|
|
|
|
'priority',
|
|
|
|
'status',
|
|
|
|
],
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Question',
|
|
|
|
value: 'question',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Incident',
|
|
|
|
value: 'incident',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Problem',
|
|
|
|
value: 'problem',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Task',
|
|
|
|
value: 'task',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'question',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
field: [
|
2020-10-22 06:46:03 -07:00
|
|
|
'priority',
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
hide: {
|
|
|
|
operation:[
|
|
|
|
'changed',
|
|
|
|
'not_changed',
|
|
|
|
],
|
|
|
|
field: [
|
|
|
|
'assignee',
|
|
|
|
'group',
|
|
|
|
'type',
|
|
|
|
'status',
|
|
|
|
],
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-01-06 16:52:37 -08:00
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Low',
|
|
|
|
value: 'low',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Normal',
|
|
|
|
value: 'normal',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'High',
|
|
|
|
value: 'high',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Urgent',
|
|
|
|
value: 'urgent',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'low',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
2020-01-06 16:52:37 -08:00
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
2020-01-06 16:52:37 -08:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getGroups',
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
field: [
|
2020-10-22 06:46:03 -07:00
|
|
|
'group',
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
hide: {
|
|
|
|
field: [
|
|
|
|
'assignee',
|
|
|
|
'priority',
|
|
|
|
'type',
|
|
|
|
'status',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
2020-01-06 16:52:37 -08:00
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
2020-01-06 16:52:37 -08:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getUsers',
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
field: [
|
2020-10-22 06:46:03 -07:00
|
|
|
'assignee',
|
2020-01-06 16:52:37 -08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
hide: {
|
|
|
|
field: [
|
|
|
|
'group',
|
|
|
|
'priority',
|
|
|
|
'type',
|
|
|
|
'status',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|