We use comala workflows to publish confluence pages. I wrote a little macro to display the publication date. However, depending on the final page status "Published" I want to derive the actual published date. I do NOT want something like the last modification date as done and working here:
$action.dateFormatter.formatGivenString($paramMYDATE,$content.getLastModificationDate())
The problem is, I do not know how to fetch the actual publication date, as the modification date is not what I am looking for:
$content.getLastModificationDate()
In the comala workflow definition, I am able to set custom metadata like this.
{set-metadata:approveddate}@datetime@{set-metadata}
And I can use the comala "Get-Metadata" Plugin to fetch the actual value. But I need to fetch the metadata from a common confluence user-macro.
I want something like:
$content.getApprovedDate()
(My example does not work...)
Is there any easy method to fix my issue? If not, is there any easy way to display the available methods?
Hi!
I would recommend you using the macros included with Comala Workflows (Now called Comala Document Management) set-metadata and get-metadata. Those macros will allow you to save information by using triggers and retrieve those values in the markup or the page. Because an example makes always easier to understand those concepts please test the following markup:
{workflow:name=Simple approval workflow with page header}
{pageheader:visibility=all}
|| Document Status |{pagestatus}|
|| Owner |@creator>fullname@ |
|| Approved By |@First approval>approvers@ |
|| Last reviewer|{get-metadata:name=Last reviewer}|
|| Approval Date/Time |{get-metadata:name=approveddate}|
|| Approval Comment |{get-metadata:name=apcomment}|
{pageheader}
{state:In Progress|approved=Approved|description=Please assign two members of your team|taskable=true}
{approval:First approval|assignable=true}
{state}
{state:Approved|final=true|updated=In Progress|hideselection=true}
{state}
{trigger:pageapproved|approval=First approval}
{set-metadata:approvedby}[~@user@]{set-metadata}
{set-metadata:approveddate}@datetime@{set-metadata}
{set-metadata:apcomment}@approvalcomment@{set-metadata}
{trigger}
{trigger:statechanged|state=Published}
{set-metadata:Last reviewer}[~@user@]{set-metadata}
{trigger}
{workflow}
It will display a page header like this:
In case that you would prefer to retrieve the metadata values directly in your page, for example to use it in page properties table or a page template you could call the get metadata macro:
I hope the example helped you to implement your workflow. Please find below related links in the Comalatech wiki:
https://wiki.comalatech.com/display/CDML/set-metadata+macro
https://wiki.comalatech.com/display/CDML/get-metadata+macro
https://wiki.comalatech.com/display/CDML/Value+References
Best regards,
Jorge
Thanks a lot Jorge!
I think you showed a comala worflow definition. However, I really want to fetch the set metadata from a confluence user-macro.
E.g. the
{set-metadata:approveddate}@datetime@{set-metadata}
Reason for that is that the user-macro currently used is already in place for many pages. I can fetch that easily using the comala "Get Metadata" macro. But this is not what I need. I'll edit my original post for clarification!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! This really helped me. But I have a problem now: the time zone is the wrong one. Do you know how to change it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I answered your question here: https://community.atlassian.com/t5/Confluence-questions/Change-Time-Zone-in-Comala-Workflow/qaq-p/1693601
All the best
James
Senior Product Manager
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.