2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-01-29 11:08:27 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const issueAttachmentOperations: INodeProperties[] = [
|
2021-01-29 11:08:27 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-01-29 11:08:27 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
|
|
|
description: 'Add attachment to issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Add an attachment to an issue',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get an attachment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get an attachment from an issue',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-01-29 11:08:27 -08:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Get many attachments',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many issue attachments',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
|
|
|
description: 'Remove an attachment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Remove an attachment from an issue',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'add',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-01-29 11:08:27 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const issueAttachmentFields: INodeProperties[] = [
|
2021-01-29 11:08:27 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issueAttachment:add */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Issue Key',
|
|
|
|
name: 'issueKey',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['add'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['add'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Object property name which holds binary data',
|
2021-01-29 11:08:27 -08:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issueAttachment:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Attachment ID',
|
|
|
|
name: 'attachmentId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['get'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the attachment',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Download',
|
|
|
|
name: 'download',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['get'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
name: 'binaryProperty',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['get'],
|
|
|
|
download: [true],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Object property name which holds binary data',
|
2021-01-29 11:08:27 -08:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issueAttachment:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Issue Key',
|
|
|
|
name: 'issueKey',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['getAll'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['getAll'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Download',
|
|
|
|
name: 'download',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['getAll'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
name: 'binaryProperty',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
download: [true],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Object property name which holds binary data',
|
2021-01-29 11:08:27 -08:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issueAttachment:remove */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Attachment ID',
|
|
|
|
name: 'attachmentId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issueAttachment'],
|
|
|
|
operation: ['remove'],
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the attachment',
|
2021-01-29 11:08:27 -08:00
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
];
|