2022-08-01 13:47:55 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-09-22 08:48:50 -07:00
|
|
|
|
|
|
|
export const caseCommentOperations: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
noDataExpression: true,
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
|
|
|
description: 'Add a comment to a case',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Add a comment to a case',
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a case comment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a case comment',
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-09-22 08:48:50 -07:00
|
|
|
value: 'getAll',
|
|
|
|
description: 'Retrieve all case comments',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many case comments',
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
|
|
|
description: 'Remove a comment from a case',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Remove a comment from a case',
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a comment in a case',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a comment from a case',
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'add',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const caseCommentFields: INodeProperties[] = [
|
|
|
|
// ----------------------------------------
|
|
|
|
// caseComment: add
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Case ID',
|
|
|
|
name: 'caseId',
|
|
|
|
description: 'ID of the case containing the comment to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['add'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Comment',
|
|
|
|
name: 'comment',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['add'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
displayName: 'Simplify',
|
2021-09-22 08:48:50 -07:00
|
|
|
name: 'simple',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['add'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: true,
|
|
|
|
description: 'Whether to return a simplified version of the response instead of the raw data',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['add'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Owner',
|
|
|
|
name: 'owner',
|
|
|
|
type: 'string',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Valid application owner registered within the Cases Role Based Access Control system',
|
2021-09-22 08:48:50 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// caseComment: get
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Case ID',
|
|
|
|
name: 'caseId',
|
|
|
|
description: 'ID of the case containing the comment to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['get'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Comment ID',
|
|
|
|
name: 'commentId',
|
|
|
|
description: 'ID of the case comment to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['get'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// caseComment: getAll
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Case ID',
|
|
|
|
name: 'caseId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['getAll'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['getAll'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
default: 50,
|
|
|
|
description: 'Max number of results to return',
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// caseComment: remove
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Case ID',
|
|
|
|
name: 'caseId',
|
|
|
|
description: 'ID of the case containing the comment to remove',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['remove'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Comment ID',
|
|
|
|
name: 'commentId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['remove'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// caseComment: update
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Case ID',
|
|
|
|
name: 'caseId',
|
|
|
|
description: 'ID of the case containing the comment to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['update'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Comment ID',
|
|
|
|
name: 'commentId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['update'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Comment',
|
|
|
|
name: 'comment',
|
|
|
|
description: 'Text to replace current comment message',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['update'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-05-20 14:47:24 -07:00
|
|
|
displayName: 'Simplify',
|
2021-09-22 08:48:50 -07:00
|
|
|
name: 'simple',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['caseComment'],
|
|
|
|
operation: ['update'],
|
2021-09-22 08:48:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: true,
|
|
|
|
description: 'Whether to return a simplified version of the response instead of the raw data',
|
|
|
|
},
|
|
|
|
];
|