2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2022-03-20 02:11:06 -07:00
|
|
|
|
|
|
|
export const issueOperations: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2022-03-20 02:11:06 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create an issue',
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete an issue',
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get an issue',
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2022-03-20 02:11:06 -07:00
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all issues',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many issues',
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update an issue',
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const issueFields: INodeProperties[] = [
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issue:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2022-03-20 02:11:06 -07:00
|
|
|
name: 'teamId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2022-03-20 02:11:06 -07:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['create'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Title',
|
|
|
|
name: 'title',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['create'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['create'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Assignee Name or ID',
|
2022-03-20 02:11:06 -07:00
|
|
|
name: 'assigneeId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2022-03-20 02:11:06 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getUsers',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Priority Name/ID',
|
|
|
|
name: 'priorityId',
|
|
|
|
type: 'options',
|
2022-06-03 10:23:49 -07:00
|
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
2022-03-20 02:11:06 -07:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Urgent',
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'High',
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Medium',
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Low',
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'No Priority',
|
|
|
|
value: 0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'State Name or ID',
|
2022-03-20 02:11:06 -07:00
|
|
|
name: 'stateId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2022-03-20 02:11:06 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getStates',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issue:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Issue ID',
|
|
|
|
name: 'issueId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['get', 'delete'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issue:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['getAll'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
default: 50,
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 300,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Max number of results to return',
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* issue:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Issue ID',
|
|
|
|
name: 'issueId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['update'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['issue'],
|
|
|
|
operation: ['update'],
|
2022-03-20 02:11:06 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Assignee Name or ID',
|
2022-03-20 02:11:06 -07:00
|
|
|
name: 'assigneeId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2022-03-20 02:11:06 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getUsers',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Priority Name/ID',
|
|
|
|
name: 'priorityId',
|
|
|
|
type: 'options',
|
2022-06-03 10:23:49 -07:00
|
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
2022-03-20 02:11:06 -07:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Urgent',
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'High',
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Medium',
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Low',
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'No Priority',
|
|
|
|
value: 0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'State Name or ID',
|
2022-03-20 02:11:06 -07:00
|
|
|
name: 'stateId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2022-03-20 02:11:06 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getStates',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2022-03-20 02:11:06 -07:00
|
|
|
name: 'teamId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2022-03-20 02:11:06 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Title',
|
|
|
|
name: 'title',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|