Hi all,
I am looking for tips on how to get an automation working where I need to query a Short Text field. For context, the field is used for our support team to enter the Client ID and I need to be able to filter out a client. The problem is, the short text field can sometimes contain that particular client exclusively, or it may be part of a list separated by a comma most times.
From what I am reading from the articles linked below, the comma is ignored from the search criteria.
https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/
The purpose of the automation is to generate a subtask except if the Client ID is XYZ (for example).
Is there a way to get the search to recognize the comma or do we need a different approach altogether. We aren't able to change the field type to a drop-down due because that would be a big change in process overall for many teams from my understanding. Also, we are not using Scriptrunner.
TIA
You can search a text field for specific words or phrases by using the advanced search like this:
myField ~ "\"my phrase\""
It this case it would only return issues with that specific phrase in the field, it would not return issues that has just my or just phrase.
I use this in automations that checks for specific words like a key or specific description.
Yes I have tried this format but the comma is being ignored. So for example if the client ID contains multiple values separated by a comma (i.e ATLASSIAN, JIRA) but I want to filter the field so it only includes issues where the value is part of a list, myField ~ "\"ATLASSIAN,\"" will return issues where both ATLASSIAN is the only value and part of a list.
Hope that makes sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately the advanced search cannot differentiate between the phrase being part of a list or not. But since you are using an automation you could do this smart values for text to check the length of the value to see if it is part of a list or not. You could also use match or split to do that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Natasha Richardson
I am thinking about this approach: I will remove the word 'ATLASSIAN' from the text field. If the field still contains any characters, it means the field does not contain only the value 'ATLASSIAN' and a subtask needs to be created.
Advancondition compare
{{issue.Client ID.remove("ATLATSSIAN")}}
does not match regex expression
^$
Then create subtask
{{issue.Client ID.remove("ATLATSSIAN")}}
match regex expression
^$
(is mean empty ) so do nothing
Hope this can help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Natasha Richardson
I am thinking about this approach: I will remove the word 'ATLASSIAN' from the text field. If the field still contains any characters, it means the field does not contain only the value 'ATLASSIAN' and a subtask needs to be created.
Advancondition compare
{{issue.Client ID.remove("ATLATSSIAN")}}
does not match regex expression
^$
Then create subtask
{{issue.Client ID.remove("ATLATSSIAN")}}
match regex expression
^$
(is mean empty ) so do nothing
Hope this can help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi thanks, just seeing your reply. That's an interesting approach. So this would remove the client ID (ATLASSIAN) from the field temporarily?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Natasha Richardson
Can client names/IDs include spaces? Can they include other non-alphanumeric characters?
Are you searching the field based on a complete client name/ID? Or are you searching based on a partial name/ID?
Could the text for which you are searching match to more than one client in the field?
Can you provide more details not on the search, but the automation you are trying to create?
The purpose of the automation is to generate a subtask except if the Client ID is XYZ (for example).
Are you trying to generate just one subtask, or one subtask per client specified in that field?
Are you simply trying to confirm that the field doesn't include the specified client but does include other clients? Or are you trying to also somehow use the field contents but exclude the client from the content when you use it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From my understanding, the client ID is alphanumeric, no spaces or symbols but since it's a text field it can contain that. But in this case, the client ID we want to filter against is all letters, no spaces, numbers, or special characters.
We are searching the field based on the full client ID which is one word for example ATLASSIAN.
The client ID/names are unique.
We are trying to exclude the issue IF the Client ID only contains a specific client. So lets say the Client ID is ATLASSIAN, we want to check if the field contains ONLY the value ATLASSIAN and the automation should ignore the issue and NOT create a subtask.
We DO NOT want to exclude issues IF ATLASSIAN is in the field along with other Client IDs separated by a comma. For example, ATLASSIAN, JIRA. A subtask would still need to be created for this issue.
I just had a thought about using the webhook to get the info from the Client ID field so I am going to play around with that but I don't want to complicate this if there is a better solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the client name that you want to exclude being hard coded into the rule or prompted for or extracted from some other location by the rule?
It would be helpful if you can explain the full concept of your rule, including providing screen images of the rule.
If you want to evaluate an issue that you have already retrieved by some other means in the rule you could do something like this smart condition:
Smart value: {{issue.YourTextField.remove("YourSearchText").remove(",").length()}}
Condition: is greater than
Value: 0
The smart value removes the text for which you are searching and the commas from the target field, and returns the length of the resultant string. The condition compares that to 0. If the length of the remaining string is greater than 0, then there was some other client specified in the string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've explained the full concept already. The support side types in the info in the field when the issue is created. There isn't much more to it than that. Thanks for your response. I will consider the smart value approach.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What triggers the rule?
Is it triggered based on an action for a single issues, and the you need to figure out if you should make the subtask?
Is it running on a schedule at are you using JQL within a step in the rule, and you want to incorporate this into that JQL to limit the retrieved issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The automation is very simple.
Trigger: When Issue transitions to Done
If conditions: Issue type is Bug, check values of other custom fields, and a JQL condition to find tickets where the Client ID is NOT EMPTY AND Client ID !~ "ATLASSIAN" OR Client ID ~ ", ATLASSIAN" OR Client ID ~ "ATLASSIAN,")
Then: Create a subtask for the issue that meets the conditions
The JQL is my attempt to exclude issues where the client ID field only contains the value of "ATLASSIAN" and include issues if it contains "ATLASSIAN, " or ", ATLASSIAN". The comma indicating its part of a list but commas are excluded from the search.
I hope this is clearer now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that clarification @Natasha Richardson . That is helpful.
Since you are trying to create a Condition to apply this to evaluate an issue you have already gotten in the rule, my suggestion is one alternative that should work in your rule context.
If the solution had to be JQL then I would have to spend more time researching a JQL based solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am open to other suggestions. I don't think it needs to be a JQL.
Thank you for looking into it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The answer provided by @Duc Thang TRAN is very similar to mine.
In both cases the text is not actually removed from the referenced field. The Advanced Compare is using the text in that field as a starting point and then modifying it "in memory" before comparing it to the specified value. No actual change is made to the text stored in the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up trying the API call and was able to get it working. Thanks again for all your help!
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.