I am trying to extend the Taiga node with support for tasks and userstories.
There is one field, called status, that is implemented in all three types but is just called status
.
I have two ways of implementing them. One working, but ugly, one more smooth, but not working.
Maybe you can give me an advice, why it does not work.
First working solution is to create all additional fields three times with display options for each of them like the following:
displayOptions: {
show: {
resource: [
'issue',
],
operation: [
'create',
],
},
},
do stuff.. another display options, same do stuff but with the one status field formatted different.
This solution works but Iβm not satisfied with it to make a PR.
See the changes:
https://github.com/cmprmsd/n8n/commit/ad2a97e9e02b2a7cc510cc51e9c105f132f789a7
So I thought of nesting display options but that does not work for me:
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'issue',
'userstory',
'task',
],
operation: [
'update',
],
},
},
and then I would have only to customize fields that are named the same in different contexts:
{
displayName: 'Issue Status ID',
name: 'status',
type: 'options',
displayOptions: {
show: {
resource: [
'issue',
],
operation: [
'update',
],
},
},
typeOptions: {
loadOptionsMethod: 'getIssueStatuses',
},
default: '',
},
{
displayName: 'User Story Status ID',
name: 'status',
type: 'options',
displayOptions: {
show: {
resource: [
'userstory',
],
operation: [
'update',
],
},
},
typeOptions: {
loadOptionsMethod: 'getUserstoryStatuses',
},
default: '',
},
{
displayName: 'Task Status ID',
name: 'status',
type: 'options',
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'update',
],
},
},
Do I have to go with option one and have tons of duplicated text?