I want to create a Jira issue with a label set on it. The label can be one of a few options:
Single word eg: example
Multi word eg: example label
Multiple labels eg: example, label
These specific labels may or may not exist in Jira prior to my trying to create an issue.
Creating an issue fails with an error saying the labels need to be in an array of strings, but that is already what I am providing.
What is the error message (if any)?
400 - {"errorMessages":[],"errors":{"labels":"Specify the value for labels in an array of strings"}}
NodeApiError: Bad request - please check your parameters
at Object.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1092:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.jiraSoftwareCloudApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Jira/GenericFunctions.js:40:16)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Jira/Jira.node.js:461:36)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:28)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:596:53
Please share your workflow
With the value of the label field being set like so:
Would you be able to share your full workflow, and perhaps provide some example data in the format and structure that you’re currently using in n8n? I’m wondering if something might be going on with that Split in Batches node but I couldn’t say for certain with the information you’ve provided
Hi @Boris_Modus - thanks for that, and now I can see that issue I’m not too sure what’s going on here, so I’ve flagged this with our developers to take a look. I’ll let you know when I have any updates!
I was just taking a look at this and the value you are sending while it looks like an array is still a string as that is what is being returning from the RSS Source.
A quick solution to this one would be to convert the datatype so in your Jira node for the Label Names try using {{ JSON.parse($('RSS Source').item.json.keyword) }} This should then change the text under it to show that it is an array.
Hmm looks like the solution was actually a bit different. The key was to remove the double quotes from the RSS Source, then the whole thing worked with a direct pointer to the object.
It should be noted that the validation for the label field should be updated to allow Arrays:
That is interesting for me it was the JSON.parse() that worked without changing the RSS Source as I was working under the assumption that the RSS data would stay the same.
The validation icon is something we are aware of and will fix it in the future.