Hello,
I am using atlassian-cli 3.4.0 to automate a number of functions after a new build is completed. One of these is to create a new blog entry on Confluence that shows the JIRA issues fixed in the latest version.
If I manually create a blog post that contains a JIRA macro with the appropriate JQL everything works fine, however if I try it using the CLI (command below), I get the error message - Unknown macro: "jira"
C:\Tools\atlassian-cli-3.4.0\confluence.bat --server https://readysell.atlassian.net/wiki --user adam --password MYPASSWORD --action addNews --space "RSELL" --title "Release Notes - 8.15.30517.Alpha" --content "<p><ac:macro ac:name="jira"><ac:parameter ac:name="server">JIRA (readysell.atlassian.net)</ac:parameter><ac:parameter ac:name="serverId">ae02c637-0cfd-33d8-a56c-e4b0dc086094</ac:parameter><ac:parameter ac:name="jqlQuery"><![CDATA[Project = "RSELL" AND FixVersion = "8.15.30517.Alpha"]]></ac:parameter></ac:macro></p>" --noConvert --labels "release-notes-alpha"
Any assistance would be appreciated.
Adam
Wiki syntax reads easier :), but you can use xhtml as well, just use " instead of ". Use single quotes around the content to avoid escaping the embedded double quotes or just escape them.
Hi Bob,
I have tried it using single quotes and unescaped double quotes as follows:
confluence.bat --server https://readysell.atlassian.net/wiki --user adam --password MYPASSWORD --action addNews --space "RSELL" --title "Release Notes - 8.15.30517.Alpha" --content '<p><ac:macro ac:name="jira"><ac:parameter ac:name="server">JIRA (readysell.atlassian.net)</ac:parameter><ac:parameter ac:name="serverId">ae02c637-0cfd-33d8-a56c-e4b0dc086094</ac:parameter><ac:parameter ac:name="jqlQuery"><![CDATA[Project = "RSELL" AND FixVersion = "8.15.30517.Alpha"]]></ac:parameter></ac:macro></p>' --noConvert --labels "release-notes-alpha"
Now, when I execute this I get this error message:
< was unexpected at this time.
And nothing is posted.
Adam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the confusion, that syntax works on Linux/Mac but not Windows. I had to get my Windows system started to verify. Here is the Windows syntax for escaping this kind of text that will get the action running, although I am unsure about your xhtml macro stuff.
atlassian confluence-4.3.0 --title "Release Notes - 8.15.30517.Alpha" --content "<p><ac:macro ac:name=\"jiraissues\"><ac:para meter ac:name=\"server\">JIRA (readysell.atlassian.net)</ac:parameter><ac:parameter ac:name=\"serverId\">ae02c637-0cfd-33d8-a56c-e4b0dc086094</ac:parameter><ac:parameter ac :name=\"jqlQuery\"><![CDATA[Project = \"RSELL\" AND FixVersion = \"8.15.30517.Alpha\"]]></ac:parameter></ac:macro></p>" --noConvert --labels "release-notes-alpha" --action addNews --space experiment
Blog created: http://xxxx:118/display/EXPERIMENT/2013/05/21/Release+Notes+-+8.15.30517.Alpha with labels: release-notes-alpha. Blog has id: 78938120
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bob,
Thanks, that did it! Escaping the quotes with a backslash rather than using " fixed the macro.
Adam
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.