Hey there,
I use the ConfiForm makro in Confluence to generate a Jira Issue.
In the Macro body I defined the Object with JSON.
But I somehow cannot pass multiple components to create the Jira Ticket... anyone has a clue what is the correct syntax / where my mistake is? I tried out multiple syntaxes but none worked so far...
The code below is my latest try.
{
"fields": {
"project": {
"id": "XXXX"
},
"summary": "Summary1",
"description": "Description1",
"issuetype": {
"id": "XXXX"
},
"components": {
"name": [
"Component1",
"Component2"
]
},
"labels": [
"Label1",
"Label2"
]
}
}
According to Jira documentation it goes like this
"components": [
{
"name": "Component1"
},
{
"name": "Component2"
}
],
Alex
Hi Alex,
that was one of my very first tries..
But this error occures:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please have a look more carefully at what I have suggested to do and your "error"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That exactly is the thing:
The JSON code which generates this error looks like that:
{ "fields": { "project": { "id": "XXXX" }, "summary": "XXXX", "description": "XXX", "issuetype": { "id": "XXX" }, "components": [ { "name":"Component1" }, { "name":"Component2" } ], "labels": [ "Label1", "Label2" ] } }
So basically it is the same code as you commented.. I dont know why there are missing brackets in the error....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does it shows the same error about the broken JSON?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope. My latest code generates the broken JSON error and yours leads to the could not prepare json code....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a perfectly valid JSON
{ "fields": { "project": { "id": "XXXX" }, "summary": "XXXX", "description": "XXX", "issuetype": { "id": "XXX" }, "components": [ { "name":"Component1" }, { "name":"Component2" } ], "labels": [ "Label1", "Label2" ] } }
Could you share the actual configuration - page storage format?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding to Alex's answer...
Here is the documentation reference to check: https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html
And, please check for any stray / trailing commas. In your post about "one of my first tries" there is definitely a stray comma.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.