I have an automation that does a simple mapping based on a label field. But now I want the automation to run only if certain values of this field are chosen.
For example:
The trigger of the automation is the change of the value of the label field.
The values "[X] Example1" and "[X] Example2" are relevant for the automation, but "[Y] Example1" is not. Therefore, a condition should be created that checks the newly added value, which is also the trigger, to see if it contains an "[X]". If this is the case, the automation should continue.
However, there are two problems:
1. I have not found a way to use the operator "contains" for the label field, since it isnt a text-field.
2. i already tried to use the Smart Values {{fieldChange.toString}}, {{addedfieldChange.values}} etc. to read out the newly added values, but this didnt work. I had a comment created, which would output the corresponding Smart Values, and they were empty.
Does anyone here have any ideas on how to implement this?
Hi @Yannik
Welcome to the Atlassian community!
You can create the automation rule as follows. But, the only catch is that the label which you want to check for, should already be created before you create the automation rule.
Enclosing the screenshot here for your reference.
Hope this helps.
Thanks,
Vamsi
Thank you for your reply!
Thats exactly what i've tried, but the "contains any of" operator only accepts specific values.
So i can't do something like "Label contains any of [X]*" or something similar, because I have to type in the specific values such as e.g. "[X] Example1".
And also since the label-field isnt a text field, i cant use something like ~ "[X]" in a jql query. I just want to check if the value contains the "[X]".
Do you have any other idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Yannik
Welcome to the Atlassian community!
Can you show us the rule you have constructed?
Using the Issue Fields Changed trigger and specifying the Labels field, when I use the Log action to print out the {{fieldChange.fromString}} and {{fieldChange.toString}} smart values I do get output in the rule Audit Log.
Also, I can used an Advanced Compare condition to look at the content of the {{fieldChange.toString}} and compare it to a string with the "contains" operator to see if the results include a label with the partial string I seek. That comparison doesn't tell me if the value was newly added or was there before, though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply! As you can see the automation is pretty simple:
The trigger is "value changes for Label" and after that there is a simple If condition, which checks, if the label has a certain Value (censored, but it contains the word "Test") and based on that, a comment is being created.
Between the Trigger and the condition, i created a new condition, which should check, if the newly added value contains "Test". So if there is any Label, which doesnt contain the word "Test" being added, it doesnt have to run the whole automation. I tried to use the Smartvalue "fieldchange.toString", but in this simple example, the automation stops at this point.
I think this is because the SmartValue is empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Before the "If: Compare two values" component add a Log action to print the smart values to the rule Audit Log.
Add another Log action to print {{fieldChange.toString}}
This is the type of output I see when I add another label to the Labels field.
Can you show the details of the new condition that you added?
Note that the new condition you create is not checking if the newly added Label contains "Test". It is checking if any of the Labels contain "Test".
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.
Yes, this entire post is about the use of Automation for Jira functionality.
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.