Hi,
I'm new to Comala Workflow Document, I want to set an approval macro based on creator,
which means that if the creator is in group A (group of confluence users define in confluence), the approver must be User 1, if the creator is in group B, the approver must be User 2.
how can I write these conditions in approval macro? is it possible?
Please help. Thanks
Hello @Maahshid Vaziri
Please find below one potential approach, you will need to replace the lines with <angle brackets> with the correct values
{workflow:name=Conditional Approver Example}
{workflowparameter:Approver 1|type=user}
<Approver 1 user name>
{workflowparameter}
{workflowparameter:Approver 2|type=user}
<Approver 2 user name>
{workflowparameter}
{workflowparameter:Creator Group A|type=group}
<Creator Group A name>
{workflowparameter}
{workflowparameter:Creator Group B|type=group}
<Creator Group A name>
{workflowparameter}
{state:In Progress|approved=Approved|taskable=true}
{approval:Review|user=@Approver@}
{state}
{state:Approved|final=true|updated=In Progress|hideselection=true}
{state}
{trigger:pagecreated|group=@Creator Group A@}
{set-metadata:Approver}@Approver 1@{set-metadata}
{trigger}
{trigger:pagecreated|group=@Creator Group B@}
{set-metadata:Approver}@Approver 2@{set-metadata}
{trigger}
{workflow}
Note that this only works in Space Mode with Pages (not blogs) on newly created pages. If you have more complex requirements, for example you have existing pages that you want to follow a similar rule, please could you open a ticket with us at https://support.comalatech.com
Kind regards
James
Many thanks, @James Conway, I think it gonna work.
one other question I've, I create Groups in Confluence, Should I create workflow parameters again or I can call it only?
and Just for info, if I set Metadata, shouldn't I use the get-metadata macro when I want to get and use it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I set this trigger in the markup so that when the page is created, the approver is also specified, but when the page is created in space, no one is assigned the approval.
{workflow:name=Simple Approval |key=spaceworkflow-1119345224}
{description}
A Simple Approval Workflow, a page's state can be for 'Review','Approved' or 'Rejected'. Only 'Approved' pages are visible to Read-Only users.
{description}
{pageheader}
||Owner|@creator@|
{pageheader}
{workflowparameter:Approver 1|type=user}
admin
{workflowparameter}
{workflowparameter:Approver 2|type=user}
K.Sh
{workflowparameter}
{workflowparameter:Creator Group A|type=group}
Comfort
{workflowparameter}
{workflowparameter:Creator Group B|type=group}
PMT
{workflowparameter}
{state:Editing|approved=Approved|rejected=Rejected|taskable=true}
{approval:Technical|user=@Approver@|exclude=@creator@}
{state}
{state:Approved|final=true|updated=Editing}
{state}
{state:Rejected|updated=Editing|taskable=true|colour=#FF5630}
{approval: Design}
{state}
{trigger:pageapproved|approval=Editing|partial=true}
{send-email:user=@creator@|Subject=Your recent Review Group approval}
Your Page Has been Approved By @approvalassignees@
{send-email}
{trigger}
{trigger:pagecreated|group=@Creator Group A@}
{set-metadata:Approver}@Approver 1@{set-metadata}
{trigger}
{trigger:pagecreated|group=@Creator Group B@}
{set-metadata:Approver}@Approver 2@{set-metadata}
{trigger}
{workflow}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Maahshid Vaziri
One - I create Groups in Confluence, Should I create workflow parameters again or I can call it only?
Two - if I set Metadata, shouldn't I use the get-metadata macro when I want to get and use it
Three - no one is assigned the approval.
...
{state:Start|submit=Editing}
{state}
{state:Editing|approved=Approved|rejected=Rejected|taskable=true}
{approval:Technical|user=&@Approver@|exclude=@creator@}
{state}
...
If you have further questions, you'll get a more timely answer by contacting our friendly Customer Success team at https://support.comalatech.com
Kind regards
James
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.