Hi All,
We have created an automation to automatically create Confluence page whenever Jira issue got created.
For that we created a template in Confluence and added a label(tracker-record) to it.
With this template we created a sample page(where the label is automatically get added to the page) and copied the page storage format.
Then we converted the storage format to json and added that in our Jira Automation custom body to automatically create Confluence page using this template format.
But the information related to labels are not showing in the page storage format.
We were able to create the confluence page automatically whenever jira issue got created, but the labels (tracker-record)are not getting added to the pages as it is not there in the page storage format. Now we are adding the label manually.
The label details are not showing in the page storage format, even thought the labels are added in the page.
Is there any way to retrieve the label details so that we can add that in the custom body of our Automation.
Please help us to resolve this issue.
Thank you!
Regards
Arya
As you noticed, labels are not part of the page's content and it is by design. Labels are entities that are added to the page, but they don't become part of that.
If you want to add the labels to the page from the automation, then you need to use the automation action that works with labels separately, in the next step after the page was created.
Hi,
Thank you for the suggestion.
We tried to add the label information in Automation after creating the page.
For that we added the below code in our jira automation, after page creation.
"metadata": {
"labels": [
{ "prefix": "global",
"name": "tracker-label" }
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why don't you use the dedicated action called Add Label instead of working with these low-level JSONs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are using Jira Automation for Confluence page creation (ie create Confluence page when Jira issue got created) there Add Label action is not there and also in confluence datacenter Automation feature is not available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then you have to use the "Send web request" automation action to call this Confluence REST API end-point:
https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#content/{id}/label-addLabels
See the JSON at the end-point's doc. Yours is not correct, no need for "metadata" and such.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tried this method after creating the page, but getting 404 error.
The user have the permission to view the content and we tried this method after creating the Confluence page(with same user itself) still getting 404 error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
404 suggests that the page cannot be accessed. Either ID is wrong or the authentication credentials are wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are using the same authentication credentials as we used for page creation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to be sure, are you setting the ID of the newly created page to the second REST API call's URL to replace the {id} placeholder?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes we are passing the ID of newly created page. Like this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try this URL format?
https://example.com/rest/api/content/39747978/label
In our Confluence this is the URL that works. Note that I had to add "/api"!
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.