(Comala Workflows) Can I set a condition based on the number of labels or other calculations?

Charles Palmer October 17, 2018

So I know I can do this...

{workflow:name=haslabel condition}   
{state:First}   
{state}   
{state:Second}   
{state}   
{trigger:statechanged|state=Second|haslabel=test}      
{set-message:duration=PT1M}
         We are in Second state, and the page has the "test" label
      {set-message}
   {trigger}
{workflow}

Or inverse with haslabel=!test.

What I'd like to do is perform the trigger based on the number of labels, or even just a "has more than just this one" type thing.  

End goal is to put a newly created page into an "Insufficient Labels" state or just set a message if the author did not add more than the default labels for the template. 

Is there any way to do that?  A hidden condition?  Is there a way to do calculations or loops in a Workflow macro?  Wildcards maybe (haslabel=*,*,*)?

1 answer

1 vote
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2018

It has been years since I have written workflows (sadly), but you can (or could) do math with the workflow. The easiest would be to set a metadata value, labelcount, and then test for that value. Basically, trigger an event each time a label is added to increment this count and update the metadata value, and then test to see if the count is greater than x in the same event. Basically, the page would stay in the "Insufficient Labels" state until your threshold is met.

Hope this points you in the right direction.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events