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: [
|
|
|
|
{
|
|
|
|
name: 'Status',
|
|
|
|
value: 'status',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Type',
|
|
|
|
value: 'type',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Priority',
|
|
|
|
value: 'priority',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Group',
|
|
|
|
value: 'group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Assignee',
|
|
|
|
value: 'assignee',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
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: [
|
|
|
|
{
|
|
|
|
name: 'Is',
|
|
|
|
value: 'is',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Is Not',
|
|
|
|
value: 'is_not',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Less Than',
|
|
|
|
value: 'less_than',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Greater Than',
|
|
|
|
value: 'greater_than',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Changed',
|
|
|
|
value: 'changed',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Changed To',
|
|
|
|
value: 'value',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Changed From',
|
|
|
|
value: 'value_previous',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed',
|
|
|
|
value: 'not_changed',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed To',
|
|
|
|
value: 'not_value',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed From',
|
|
|
|
value: 'not_value_previous',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
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: 'Is',
|
|
|
|
value: 'is',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Is Not',
|
|
|
|
value: 'is_not',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Changed',
|
|
|
|
value: 'changed',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Changed To',
|
|
|
|
value: 'value',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Changed From',
|
|
|
|
value: 'value_previous',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed',
|
|
|
|
value: 'not_changed',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed To',
|
|
|
|
value: 'not_value',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Not Changed From',
|
|
|
|
value: 'not_value_previous',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
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: [
|
|
|
|
{
|
|
|
|
name: 'Open',
|
|
|
|
value: 'open',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'New',
|
|
|
|
value: 'new',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Pending',
|
|
|
|
value: 'pending',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Solved',
|
|
|
|
value: 'solved',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Closed',
|
|
|
|
value: 'closed',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
|
|
|
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: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'options',
|
|
|
|
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
|
|
|
];
|