Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation rule: performing an action when a blog post is published with a specific label

Jared Lumpe February 8, 2024

I'm trying to set up an automation rule to send an MS teams message when a blog post with the "announcement" label is published in a specific Confluence space. I have set up the rule to use the "label=announcement" CQL condition, but it is not triggering when it is supposed to.

Here is a screenshot showing how I have the rule set up:

image.png

You can see here I added some logging actions to verify that the problem is not with the MS teams message action. Note that I clicked "validate query" on the CQL query condition and it says "Valid query. 2 contents found." Clicking this link shows two existing blog posts that match my intended criteria.

This is an entry in the audit log for a blog post which should have triggered the message but did not:

image.png

The log shows the following condition evaluated in the IF block:

(id = 33947802 AND label=announcement) AND space in ("BIOIN")

 If I use this exact query to do a CQL search using the REST API I get the expected single result which is the blog post that triggered the action.

1 answer

0 votes
Shawn Doyle - ReleaseTEAM
Community Champion
February 8, 2024

Looks like you validated the IF is being triggered and the Audit log is being updated.  I would look for some evidence that Confluence tried to send the message to Teams. 

I would verify that the Teams connection is configured correctly and test it outside of an automation.  I'd also move the audit log (or add a second one) to after the Teams call.

 

 

Jared Lumpe February 9, 2024

If you look at the audit log, it displays the message "Blot post is not an announcement" which comes from the log action in the "else" block. Unless I've structured the if/else wrong I think this means I'm not hitting the message action. I have also verified the Teams webhook is working independently.

Shawn Doyle - ReleaseTEAM
Community Champion
February 9, 2024

Ah, I mis read this statement "This is an entry in the audit log for a blog post which should have triggered the message but did not" to mean the logging step you added had triggered.

Then, I agree it's your IF statement. It is either a race condition of the label being added and the IF not seeing it, or the IF is running off the information as it has when the automation originally fired.

Either way, I would not trust the label to exist by the time the IF is tested.

 

 

Jared Lumpe February 13, 2024

Thanks Shawn. If I can't trust the label to exist, how would you suggest I go about accomplishing this?

Shawn Doyle - ReleaseTEAM
Community Champion
February 13, 2024

You can test by attaching the label before publishing.  Not a great option, but see if that would work. Or experiment with the title or body and see if you can trigger off of that.

 

Jared Lumpe February 14, 2024

Thanks for the help Shawn. What I was doing was attaching the label prior to publishing, so it seems like that information should be available when the rule is running.

Since I couldn't get this to work I'm instead having people attach the "announcement" label strictly after publishing the blog and then using the "Blog labeled" trigger for the rule.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events