I'm struggling to create an automation rule to detect when a given label is removed. E.g., if the label "Q4" is present, then removed, I want to know.
I can get the rule to trigger of a Value change for Labels field based on the value deleted change type- thats simple enough... however detecting WHAT changed is the struggle.
All searching I've done online points to checking / adding logging for smart values such as:
and a few others... but they are always blank!
What am I missing here?
Hi @Kevin Jamieson,
Because Labels is a multi-select field, several values can be added or removed in a single edit. To detect when a specific label was previously present but later removed, you need to iterate through the changes and check both states. This requires two separate conditions: one to examine the value before the edit and another to examine the value after. Here’s an example of how the rule would look:
Condition to check if label was present before edit,
{{#changelog.labels}}{{fromString}}{{/changelog.labels}}
Condition to check if label was present after edit,
{{#changelog.labels}}{{toString}}{{/changelog.labels}}
After tweaking an error being thrown based on exactly what you had as an example, the rule does not get triggered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kevin Jamieson Would it possible to share screenshot of the error? Also, if possible share screenshot of entire rule for troubleshooting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the full rule with the text you provided in the "Field Value Changed" step. The "2nd half" of the rule was from previous attempts to get this working... but those IFs (i tried various flavors) never worked for me.
I had been trying to add log actions to print these variables, but they always print nothing... like the changelog objects do not exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kevin Jamieson ,
Which automation trigger are you using?
The change log variable is present only in the edit issue operations, as Ken in the doc:
{{changelog}}
Used with: any triggers that edit an issue
Reference: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.