What I'm trying to acheive is to trigger an action (comment) when a ticket is raised based on a condition that if the text length within a custom feild exceeds a certain length (21 characters).
The conditions available to me do not seem to give me this option so I beleive I will need to use Scriptrunner? I'm just not sure how to integrate that with the JIRA Cloud automation conditions.
Please help :)
Many thanks,
Mike
Hi @Michael Savedra and welcome to the community!
So if I understand correctly, you would want something like this...
For copy/paste purposes, here's the smart value:
{{issue.customfield_xxxxx.length}}
Note - xxxxx = your custom field ID
Hi Mark, Glad to be here!
That's super helpful I will give that a try.
What I'd also be looking to do would be to add the total length of 2 custom fields and then if the sum is greater than 21, to then trigger the comment action. (First name and last name being separate custom fields). I assume this would need to be done with Scriptrunner?
Many thanks,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That should be possible with native automation as well. You could do something like this in your advanced compare condition:
{{issue.<customfield1>.concat({{issue.<customfield2>}}).length}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amazing thank you Mark!
Seems I need to familiarise myself with the smart values a bit more.
Much appriciated :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happy to help! Yes - Smart Values are amazingly powerful. Here is my favorite reference (note - this takes you to text fields, but the right navigation has a plethora of other docs on them):
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
The first example you shared works perfectly. When concatenating teh two fields though, the automation doesn't seem to recognise the Smart value i've put in. Am I formatting this correctly?:
"{{issue.customfield_21635.concat({{issue.customfield_21636}}).length}}"
Thanks in advance,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ignore me I figured it out (second set of curly braces not required)
Thanks again for 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.