2021-01-29 11:08:27 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all attachments',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get all 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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
name: 'binaryProperty',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
download: [
|
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
name: 'binaryProperty',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
download: [
|
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
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: {
|
|
|
|
resource: [
|
|
|
|
'issueAttachment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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
|
|
|
];
|