You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Looking for advice on streamlining an automation.
I'd like to have a list of values (applications/components/common pain points). For each issue created, i'd like to check the Summary and Description against that list, and for each match (eg summary OR description contains WiFi and Printing, to then add a label for each match. So this example would add 2 labels - 'WiFi' and 'Printing'.
I'm trying to condense this from a whole bunch of If/Else blocks... would appreciate any thoughts
Hi @Daniel Helmstedt -- Welcome to the Atlassian Community!
One way to do this would be to create your list of check values in a created variable, separated by commas. And then use advanced branching to iterate over them. For example
Another way to do this is with a regular expression, copying the source field (e.g. Summary) to a created variable, and then replacing anything not in your search list of terms with an empty string. Then parse the results into a smart value list and add all of the labels at one time using an advanced JSON edit expression.
Kind regards,
Bill
Thanks Bill! That's a much simpler flow than I was working on!
How would you go about checking the smart value against both Summary and Description - can that be done in one step?
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Daniel.
If you mean the second thing I suggested, I meant removing the non-matching expressions (i.e. to your tests) with a RegEx and then using the remainder to create the list for the labels. This is certainly going to take a bit of experimentation to get correct; the specifics of your search strings may not make this approach viable.
The first approach I noted should be easy to try and get working...giving you time to experiment with the second approach. That would only require use of advanced compare conditions with "contains" or use of the text searching functions.
Regarding your ask about checking Summary and Description in one step, you could concatenate them first, and then test for the string match.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
I checked the link for text searching functions, as I wanted to do something similar, but I couldn't find anything for 'contains' other than contains all letter or all numbers, not matching keywords.
How does the syntax to match keywords work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Matthew. Please try using match() with a regular expression, and then check that the result is not empty to then add the relevant labels.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
I should probably have created a new ticket but this is exactly what I was searching for. I am trying to do the same thing but I just started yesterday.
would it be possible to further explain this:
How do I create a list, I’ve read through the smart values list but I am unsure of how to create a list
And once I do the check if the value is found, how do I input that as a label. I can’t see any way to pass the information from the list into the labels based on the results. If I could find out in general how this is done it would be great, because being able to pass the information from the branch to the action would be great
your help would be highly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan Van Zyl -- Welcome to the Atlassian Community!
First thing: lists
To make a list, you supply the values with some delimiter, such as comma. That will still be a text string. Then when you need it as an actual list, you can use the split() function for use as needed. For example...
Next thing: adding your found value as a label
This is the easy part, using Edit Issue, select Labels, the ... option to Add/Remove labels, and then just enter your smart value of {{myLabel}} from the branch. The "trick" is to type in your smart value in the field and it will appear below the field; when it does, select it to use it.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much, I understand now how I am supposed to use smart values. I work for a big company (this is not my company email) and they want me to automate a lot so this really has saved me a lot of time.
Thank you so much again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy @Ryan Van Zyl Can you elaborate on the first method explained (see below). I'm still not getting how to realise this.
"That would only require use of advanced compare conditions with "contains" or use of the text searching functions.
Regarding your ask about checking Summary and Description in one step, you could concatenate them first, and then test for the string match."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The idea would be to use functions, such as match(), to extract the text you want to search, and use the value to check in the second compare value.
Another approach, suggested earlier, is to build a list of value to check in a created variable, and then iterate over them with and advanced branch to check them one by one.
If you already have a rule which is not working as you expect, I suggest creating a new question, adding a link to this post, and including images of your complete rule and audit log details. That will help more members of the community to see it and offer suggestions. Otherwise only the people currently following this post will see your question.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Community!!
If you have a predefined list of labels that's best, otherwise, it's not recommended.
Have the list of labels predefined, and going forward for once you need to create the label and add it in automation.
The Automation would go like this
Trigger - Issue Created
Condition - JQL Condition to check whether labels you manually added once is present in Summary/Description
Action - Add the label
Thanks,
Pramodh
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.