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:
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:
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.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Shawn. If I can't trust the label to exist, how would you suggest I go about accomplishing this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.