Hi,
Im trying to create an automation rule that looks at the subject or description of emails for key terms that are defined as an asset. The automation rule should then update the work item and update the queue field and assign then assign a user to the ticket. This is all working but only when the subject field in the asset is all lower case.
What i wanted to do was this:
"type": "jira.comparator.condition",
"value": {
"first": "{{issue.summary.toLowerCase()}}",
"second": "{{businessrule.Subject.toLowerCase()}}",
"operator": "CONTAINS"
},
Where businessrule is the name of the loop value, but when using toLowerCase on the loop value it clears it so tries to match against "" and always passes. What I've ended up having to do is enter the subject in the asset to be all lower case and remove the toLowerCase() function call on the second value shown above.
Is there any way around this? In its current state if anyone were to add a new asset object with an uppercase letter it would always pass and result in every ticket going to the same queue.
Hi @Owain_Esau -- Welcome to the Atlassian Community!
As @Marc - Devoteam describes, we need to see your automation rule and audit log details to provide more context for the question. Including, what type of branch are you using?
Until we see those...
If the rule branches over object / asset data, it is possible there is a timing problem looking up the value fast enough before the toLowerCase call. The solution for that would be adding an extra step to fully evaluate the asset value, storing it in a variable first:
You may also want to confirm the case is correct for Subject, versus subject as the attribute the rule sees. This could be done by writing the value to the audit log inside the branch.
Kind regards,
Bill
Hi @Owain_Esau
Whenever you ask for help with an Automation Rule it will help us to help you if you provide:
1. what type of project is this (e.g., company-managed, team-managed, etc.),
2. images that show your complete rule.
3. images showing the details of any relevant actions/conditions/branches.
4. images showing the Audit Log details for the rule execution.
5. Explain where the issue is.
These questions are not for not willing to help, but to have community members understand on how automation works.
In you question you mention asset, what do you mean by this, assets in the term of assets in JSM?
Just a question, as terminology can throw people off.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marc,
Here are the images for the rule, I was wanting to split this into two or three rules using incoming webhooks and web requests to trigger each but we have some IP whitelisting issues atm so for now its all in the one.
1. what type of project is this (e.g., company-managed, team-managed, etc.), company-managed
2. images that show your complete rule. Below
3. images showing the details of any relevant actions/conditions/branches. Below
4. images showing the Audit Log details for the rule execution.
5. Explain where the issue is.
The images below show the updated rule without the toLowerCase call (ive updated the rule to not use it but added regex validation on the asset attributes which is not ideal) The issue seen in the log above "Comparing testing with ''" happens when i change this comparison to use {{businessrule.Subject.toLowerCase()}}.
Which results in it always passing the check.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Owain_Esau
I concur with @Bill Sheboy
Create a variable based on the businessrule.Subject, within the variable to information will be stored as text and then use the toLowerCase on the variable
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.