2021-04-30 14:00:28 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const workItemOperations : INodeProperties [ ] = [
2021-04-30 14:00:28 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-04-30 14:00:28 -07:00
default : 'get' ,
options : [
{
name : 'Create' ,
value : 'create' ,
} ,
{
name : 'Get' ,
value : 'get' ,
} ,
{
name : 'Get All' ,
value : 'getAll' ,
} ,
{
name : 'Update' ,
value : 'update' ,
} ,
] ,
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-04-30 14:00:28 -07:00
2021-12-03 00:44:16 -08:00
export const workItemFields : INodeProperties [ ] = [
2021-04-30 14:00:28 -07:00
// ----------------------------------
// workItem: create
// ----------------------------------
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
required : true ,
2022-05-06 14:01:25 -07:00
description : 'Title of the work item to create' ,
2021-04-30 14:00:28 -07:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
2021-12-18 03:05:29 -08:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2021-12-18 03:05:29 -08:00
name : 'spaceId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : [ ] ,
required : true ,
2022-06-03 10:23:49 -07:00
description : 'ID of the space to retrieve the work items from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-12-18 03:05:29 -08:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
2021-04-30 14:00:28 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Status Name or ID' ,
2021-04-30 14:00:28 -07:00
name : 'statusId' ,
type : 'options' ,
typeOptions : {
2021-12-18 03:05:29 -08:00
loadOptionsDependsOn : [ 'spaceId' ] ,
2021-04-30 14:00:28 -07:00
loadOptionsMethod : 'getStatuses' ,
} ,
default : [ ] ,
required : true ,
2022-06-03 10:23:49 -07:00
description : 'ID of the status to set on the item to create. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-04-30 14:00:28 -07:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
options : [
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
description : 'Description of the item to create. Markdown supported.' ,
} ,
{
displayName : 'Effort' ,
name : 'effort' ,
type : 'options' ,
default : 'SMALL' ,
2022-05-06 14:01:25 -07:00
description : 'Effort to set for the item to create' ,
2021-04-30 14:00:28 -07:00
options : [
{
name : 'Small' ,
value : 'SMALL' ,
} ,
{
name : 'Medium' ,
value : 'MEDIUM' ,
} ,
{
name : 'Large' ,
value : 'LARGE' ,
} ,
] ,
} ,
{
displayName : 'Impact' ,
name : 'impact' ,
type : 'options' ,
default : 'SMALL' ,
2022-05-06 14:01:25 -07:00
description : 'Impact to set for the item to create' ,
2021-04-30 14:00:28 -07:00
options : [
{
name : 'Small' ,
value : 'SMALL' ,
} ,
{
name : 'Medium' ,
value : 'MEDIUM' ,
} ,
{
name : 'Large' ,
value : 'LARGE' ,
} ,
] ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Label Names or IDs' ,
2021-04-30 14:00:28 -07:00
name : 'labelIds' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getLabels' ,
} ,
default : [ ] ,
2022-06-20 07:54:01 -07:00
description : 'ID of the label to set on the item to create. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-04-30 14:00:28 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Member Names or IDs' ,
2021-04-30 14:00:28 -07:00
name : 'memberIds' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
default : [ ] ,
2022-06-20 07:54:01 -07:00
description : 'ID of the user to assign to the item to create. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-04-30 14:00:28 -07:00
} ,
] ,
} ,
// ----------------------------------
// workItem: get
// ----------------------------------
{
displayName : 'Work Item ID' ,
name : 'workItemId' ,
type : 'string' ,
default : '' ,
required : true ,
2022-05-06 14:01:25 -07:00
description : 'ID of the work item to retrieve' ,
2021-04-30 14:00:28 -07:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
} ,
// ----------------------------------
// workItem: getAll
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2021-04-30 14:00:28 -07:00
name : 'spaceId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : [ ] ,
required : true ,
2022-06-03 10:23:49 -07:00
description : 'ID of the space to retrieve the work items from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-04-30 14:00:28 -07:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2021-04-30 14:00:28 -07:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
default : 5 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2021-04-30 14:00:28 -07:00
typeOptions : {
minValue : 1 ,
maxValue : 1000 ,
} ,
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'getAll' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
} ,
// ----------------------------------
// workItem: update
// ----------------------------------
{
displayName : 'Work Item ID' ,
name : 'workItemId' ,
type : 'string' ,
default : '' ,
required : true ,
2022-05-06 14:01:25 -07:00
description : 'ID of the work item to update' ,
2021-04-30 14:00:28 -07:00
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'workItem' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
options : [
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
description : 'Description of the item to update. Markdown supported.' ,
} ,
{
displayName : 'Effort' ,
name : 'effort' ,
type : 'options' ,
default : 'SMALL' ,
2022-05-06 14:01:25 -07:00
description : 'Effort to set for the item to update' ,
2021-04-30 14:00:28 -07:00
options : [
{
name : 'Small' ,
value : 'SMALL' ,
} ,
{
name : 'Medium' ,
value : 'MEDIUM' ,
} ,
{
name : 'Large' ,
value : 'LARGE' ,
} ,
] ,
} ,
{
displayName : 'Impact' ,
name : 'impact' ,
type : 'options' ,
default : 'SMALL' ,
2022-05-06 14:01:25 -07:00
description : 'Impact to set for the item to update' ,
2021-04-30 14:00:28 -07:00
options : [
{
name : 'Small' ,
value : 'SMALL' ,
} ,
{
name : 'Medium' ,
value : 'MEDIUM' ,
} ,
{
name : 'Large' ,
value : 'LARGE' ,
} ,
] ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Status Name or ID' ,
2021-04-30 14:00:28 -07:00
name : 'statusId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getStatuses' ,
} ,
default : [ ] ,
2022-06-03 10:23:49 -07:00
description : 'ID of the status to set on the item to update. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-04-30 14:00:28 -07:00
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Title to set for the work item to update' ,
2021-04-30 14:00:28 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;